home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / menues__ / 4os2252.zip / 4OS2.INF (.txt) < prev    next >
OS/2 Help File  |  1996-04-17  |  373KB  |  11,725 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About 4OS2 Help ΓòÉΓòÉΓòÉ
  3.  
  4.                               4OS2 2.52 Help System
  5.  
  6.                 Text by Hardin Brothers, Tom Rawson, and Rex Conn
  7.  
  8. Program and Text Copyright 1988 - 1996, JP Software Inc., All Rights Reserved. 
  9.  
  10. 4OS2 is a trademark and 4DOS is a registered trademark of JP Software Inc. 
  11. OS/2 is a registered trademark of IBM Corporation.  Other product and company 
  12. names are trademarks of their respective owners. 
  13.  
  14. [04/96 - 2.52] 
  15.  
  16.  
  17. ΓòÉΓòÉΓòÉ 2. Using the 4OS2 Help System ΓòÉΓòÉΓòÉ
  18.  
  19. This online help system for 4OS2 covers all 4OS2 features and internal 
  20. commands.  It includes reference information to assist you in using 4OS2 and 
  21. developing batch files; however it does not include all of the details which 
  22. are included in the printed 4OS2 manuals. 
  23.  
  24. If you type part or all of a command on the line and then press F1, the help 
  25. system will provide "context-sensitive" help by using the first word on the 
  26. line as a help topic.  If it's a valid topic, you will see help for that topic 
  27. automatically; if not, you will see the list of all help topics and you can 
  28. pick the one you want. 
  29.  
  30. You can use this feature to obtain help on any topic -- not just on commands. 
  31. For example, if you enter the command HELP _DISK you will see help for the 
  32. _DISK internal variable. 
  33.  
  34. If you type the name of any internal command at the prompt, followed by a slash 
  35. and a question mark [/?] like this: 
  36.  
  37.         copy /?
  38.  
  39. then you will see help for the command in a "quick-reference" style.  Output 
  40. from a /? display may be redirected with > or >>. 
  41.  
  42. The /? option may not work correctly if you have used an alias to redefine how 
  43. an internal command operates.  To view the /? help for such a command you must 
  44. add an asterisk to the beginning of the command to disable alias processing. 
  45. For example, if you have defined this alias: 
  46.  
  47.         alias copy *copy /r
  48.  
  49. then the command COPY /? will be translated to COPY /R /?, which will not work 
  50. properly.  However, if you use *COPY /?, the alias will be ignored and the /? 
  51. will work as you intended. 
  52.  
  53. The 4OS2 help system uses OS/2's VIEW.EXE to display this help text. Once 
  54. you've started the help system with HELP or F1, you can use VIEW's standard 
  55. keystrokes to navigate.  For more information, click on the Help menu at the 
  56. top of the VIEW window. 
  57.  
  58. Configuring the Help System 
  59.  
  60. You can select which help "books" are displayed when you press the F1 key or 
  61. enter the HELP command.  A help book is a single .INF file.  This help text is 
  62. in the file 4OS2.INF. 
  63.  
  64. By default, 4OS2 opens this book and the OS/2 command reference file, 
  65. CMDREF.INF.  You can change the default books opened for the 4OS2 help system 
  66. with the HelpBook directive in 4OS2.INI.  The default setting is 4OS2+CMDREF. 
  67. For example, to load only the 4OS2 help when you press F1 or enter the HELP 
  68. command: 
  69.  
  70.         HelpBook = 4OS2
  71.  
  72.  
  73. ΓòÉΓòÉΓòÉ 3. Conventions ΓòÉΓòÉΓòÉ
  74.  
  75. This section contains information about conventions that are used throughout 
  76. 4OS2: 
  77.  
  78.             Colors and color names 
  79.             Color-coded directories 
  80.             Keys and key names 
  81.  
  82.  These topics are combined here in a central reference spot so that they will 
  83.  be easy to find when you need to refer to them.  You will find cross 
  84.  references to this section throughout the help system. 
  85.  
  86.  
  87. ΓòÉΓòÉΓòÉ 3.1. ┬áColors and Color Names ΓòÉΓòÉΓòÉ
  88.  
  89. You can use color names in several of the directives in the .INI file and in 
  90. many commands.  The general form of a color name is: 
  91.  
  92.     [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc ] 
  93.  
  94. where fg is the foreground or text color, bg is the background color, and bc is 
  95. the border color. 
  96.  
  97. The available colors are: 
  98.  
  99.         Black           Blue            Green           Red
  100.         Magenta         Cyan            Yellow          White
  101.  
  102. Color names and the words BRIght, BLInk, and BORder may be shortened to the 
  103. first 3 letters. 
  104.  
  105. You can also specify colors by number instead of by name.  The numbers are most 
  106. useful in potentially long INI file directives like ColorDir. The following 
  107. numbers are recognized: 
  108.  
  109.   0 - Black     8 - Gray (bright black)
  110.   1 - Blue      9 - Bright blue
  111.   2 - Green    10 - Bright green
  112.   3 - Cyan     11 - Bright cyan
  113.   4 - Red      12 - Bright red
  114.   5 - Magenta  13 - Bright magenta
  115.   6 - Yellow   14 - Bright yellow
  116.   7 - White    15 - Bright white
  117.  
  118. Use one number to substitute for the [BRIght] fg portion of the color name, and 
  119. a second to substitute for the [BRIght] bg portion.  For example, instead of 
  120. bright cyan on blue you could use 11 on 1 to save space in a ColorDir 
  121. specification. 
  122.  
  123. There are several subtleties that complicate the use of colors and color names. 
  124. In order to understand them, you will need to read through the restrictions 
  125. described below.  These restrictions are due to the design of your PC video 
  126. hardware and video drivers, and are not inherent in 4OS2.  Some of the 
  127. restrictions are complex, so feel free to skip over those that do not apply to 
  128. color combinations you use. 
  129.  
  130. Some restrictions depend on the display "mode."  4OS2 can run in either normal 
  131. display mode, where it uses the full screen and has more direct control over 
  132. the video hardware; or in windowed display mode, where it appears in a window 
  133. on the OS/2 desktop. 
  134.  
  135. Monochrome Video Adapters 
  136.  
  137. If you have a monochrome video adapter, you cannot display any colors except 
  138. white and black in either normal or bright intensity. If you have a color video 
  139. adapter, you can use any of the standard colors listed above (provided you meet 
  140. the other restrictions below). 
  141.  
  142. Color Errors 
  143.  
  144. A standard color specification allows sixteen foreground and eight background 
  145. colors (sixteen if bright backgrounds are enabled, see below).  However, most 
  146. video adapters and monitors do not provide true renditions of certain colors. 
  147. For example, most users see normal "yellow" as brown, and bright yellow as 
  148. yellow; many also see normal red as red, and "bright red" as pink.  Color 
  149. errors are often much worse when running in windowed mode (see above), because 
  150. the graphical environment that created the window may not map the text-mode 
  151. colors the way you expect.  These problems are inherent in the monitor, video 
  152. adapter, and driver software.  They cannot be corrected using 4OS2 color 
  153. specifications. 
  154.  
  155. Border Colors 
  156.  
  157. In order to use border colors, you must have a color video adapter (monochrome 
  158. adapters do not support border colors). 
  159.  
  160. 4OS2 can only accept border colors in the CLS and COLOR commands, and in the 
  161. StdColors directive in the .INI file.  Border colors will be ignored, or will 
  162. cause an error, if they are used elsewhere. 
  163.  
  164. Border colors do not work in windowed mode, and will be ignored if used in a 
  165. windowed session under OS/2. 
  166.  
  167. Blinking Text and Bright Background Colors 
  168.  
  169. The interactions between blinking characters, bright backgrounds, and your 
  170. display mode can be complex.  You will need to understand them if you use 
  171. either attribute in your color specifications. 
  172.  
  173. Bright background colors are only available if you have an EGA- or 
  174. VGA-compatible display adapter.  If you have a monochrome or CGA adapter, you 
  175. can use blinking displays and ignore the interactions described below. 
  176.  
  177. The effects of blinking and bright background color specifications depend 
  178. partly on whether you are in normal or windowed display mode. 
  179.  
  180. Full-Screen Display Mode 
  181.  
  182. In full-screen display mode your video hardware can be configured via software 
  183. commands to display either blinking text, or text with a bright background, but 
  184. not both.  This is due to the design of PC video hardware, and is not a 
  185. software restriction. 
  186.  
  187. The memory on your video adapter includes a "flag" for each character on the 
  188. screen.  The flag controls blinking text and bright background colors.  If the 
  189. flag is off, the character is displayed with a normal background and does not 
  190. blink.  If the flag is "on," the character either blinks or is displayed with a 
  191. bright background, depending on which way your video adapter is currently 
  192. configured. 
  193.  
  194. In full-screen display mode, the configuration of your video adapter can be 
  195. controlled by 4OS2 with the BrightBG directive in the 4OS2.INI file or the 
  196. SETDOS /B command.  If you set BrightBG = No or use the SETDOS /B0 command, 
  197. 4OS2 will configure the video adapter for blinking text, and characters with 
  198. the blink / bright background flag set will blink.  If you set BrightBG = Yes 
  199. or use SETDOS /B1, 4OS2 will configure the video adapter for bright background 
  200. colors, and the characters will be displayed with a bright background instead. 
  201.  
  202. Because there is only one flag for each character to specify both blinking text 
  203. and bright background color, it doesn't matter which attribute you use when you 
  204. specify the color.  Whether you specify blinking text or a bright background, 
  205. you will see the same thing on your screen.  For example, these two COLOR 
  206. commands will always produce the same results: 
  207.  
  208.         color blink white on blue
  209.         color white on bright blue
  210.  
  211. If bright backgrounds are enabled, both commands will produce white text on a 
  212. bright blue background.  If blinking text is enabled, both commands will 
  213. produce blinking white text on a blue background. 
  214.  
  215. If you don't use BrightBG or SETDOS /B, or if you use SETDOS /B2, 4OS2 will not 
  216. attempt to configure your video hardware.  Most video adapters default to 
  217. blinking text in normal mode, but this can be changed by application programs. 
  218. If you use BrightBG or SETDOS /B, 4OS2 will configure the hardware each time it 
  219. displays the prompt. 
  220.  
  221. The method used to adjust the video hardware may not be compatible with all 
  222. video cards.  If you see screen "flashes" at each prompt when you use BrightBG 
  223. or SETDOS /B, discontinue using both commands.  This problem is very rare and 
  224. is not likely to occur on standard EGA and VGA systems. 
  225.  
  226. Windowed Mode 
  227.  
  228. In windowed mode, 4OS2 cannot control your hardware to select blinking or 
  229. bright backgrounds.  Instead, OS/2 displays bright background colors, 
  230. regardless of the BrightBG or SETDOS /B setting.  It does not provide a way to 
  231. display blinking characters in windowed mode.  As an example, the two commands 
  232. given above would both display white text on a bright blue background when run 
  233. in windowed mode. 
  234.  
  235. Switching Modes 
  236.  
  237. OS/2 allows you to switch any DOS session between full- screen and windowed 
  238. mode.  You cannot switch modes for OS/2 sessions, so 4OS2 is not directly 
  239. affected by mode switching. However, if you write batch files or aliases which 
  240. run in both modes, you may need to take into account that OS/2 defaults to 
  241. displaying blinking text in full-screen mode and bright backgrounds in windowed 
  242. mode. 
  243.  
  244.  
  245. ΓòÉΓòÉΓòÉ 3.2. ┬áColor-Coded Directories ΓòÉΓòÉΓòÉ
  246.  
  247. The DIR and SELECT commands can display each file name in a different color, 
  248. depending on the file's extension. 
  249.  
  250. To choose the DIR and SELECT display colors, you must either use the SET 
  251. command to create an environment variable called COLORDIR, or use the ColorDir 
  252. directive in your .INI file. 
  253.  
  254. If you do not use the COLORDIR variable or the ColorDir directive, DIR will use 
  255. the default screen colors and SELECT will use the default screen colors or 
  256. those set with the SelectColors directive. 
  257.  
  258. If you use both the COLORDIR variable and the ColorDir directive, the 
  259. environment variable will override the settings in your .INI file.  You may 
  260. find it useful to use the COLORDIR variable for experimenting, then to set 
  261. permanent directory colors with the ColorDir directive. 
  262.  
  263. The format for both the COLORDIR environment variable and the ColorDir 
  264. directive in the .INI file is: 
  265.  
  266.         ext ... :ColorName; ...
  267.  
  268. where "ext" is a file extension (which may include wildcards) or one of the 
  269. following file types: 
  270.  
  271.         DIRS      Directories
  272.         RDONLY    Read-only files
  273.         HIDDEN    Hidden files
  274.         SYSTEM    System files
  275.         ARCHIVE   Files modified since the last backup
  276.  
  277. and "ColorName" is any valid color name (see Colors). 
  278.  
  279. Unlike most color specifications, the background portion of the color name may 
  280. be left out for directory colors.  If you don't specify a background color, DIR 
  281. and SELECT will use the current screen background color. 
  282.  
  283. For example, to display the .COM and .EXE files in red on the current 
  284. background, the .C and .ASM files in bright cyan on the current background, and 
  285. the read-only files in blinking green on white (this should be entered on one 
  286. line): 
  287.  
  288.         [c:\] set colordir=com exe:red; c asm:bright cyan; rdonly:blink green on white
  289.  
  290. Extended wildcards (for example "BA[KXC]" for .BAK, .BAX, and .BAC files) can 
  291. be used in directory color specifications. 
  292.  
  293. You can specify files with any extension using the * wildcard, and files with 
  294. no extension using a space.  For example, the following specification displays 
  295. files with no extension in red, .TXT files in blue, and all other files in 
  296. green: 
  297.  
  298.      [c:\] set colordir= :red;txt:blu;*:gre
  299.  
  300. If the extension or type of a file matches an extension or type listed in your 
  301. color specification, the remainder of the colors are ignored for that file. 
  302. You may need to take this into account in determining the order of extensions 
  303. and file types in your COLORDIR setting.  For example, you might try this 
  304. setting to display all .COM and .EXE files in red, and all other files whose 
  305. extension starts with a "C" in green: 
  306.  
  307.      c:\> set colordir=c*:green;com exe:red
  308.  
  309. However in this case the .COM files will be displayed in green, because they 
  310. match the "c*", and the ".com" later on the line is ignored.  To correct this 
  311. problem, change the line to read: 
  312.  
  313.      c:\> set colordir=com exe:red;c*:green
  314.  
  315.  
  316. ΓòÉΓòÉΓòÉ 3.3. ┬áKeys and Key Names ΓòÉΓòÉΓòÉ
  317.  
  318. Key names are used to define keystroke aliases, and in several 4OS2.INI 
  319. directives.  The format of a key name is the same in both uses: 
  320.  
  321.         [Prefix-]Keyname
  322.  
  323. The key prefix can be left out, or it can be any one of the following: 
  324.  
  325.         Alt         followed by A - Z, 0 - 9, F1 - F12, or Bksp
  326.         Ctrl        followed by A - Z, F1 - F12, Tab, Bksp, Enter,
  327.                       Left, Right, Home, End, PgUp, PgDn, Ins, or Del
  328.         Shift       followed by F1 - F12 or Tab.
  329.  
  330. The possible key names are: 
  331.  
  332.         A - Z           Enter           PgDn
  333.         0 - 9           Up              Home
  334.         F1 - F          Down            End
  335.         Esc             Left            Ins
  336.         Bksp            Right           Del
  337.         Tab             PgUp
  338.  
  339. All key names must be spelled as shown.  Alphabetic keys can be specified in 
  340. upper-case or lower-case.  You cannot specify a punctuation key. 
  341.  
  342. The prefix and key name must be separated by a dash [-].  For example: 
  343.  
  344.         Alt-F10        This is okay
  345.         Alt F10        The space will cause an error
  346.  
  347. If you prefer, you can use a numeric value instead of a key name. Use the ASCII 
  348. code for an ASCII, extended ASCII, or control character.  Use the scan code 
  349. preceded by an at sign [@] for extended key codes like F1 or the cursor keys. 
  350. For example, use 13 for Enter, or @59 for F1.  In general, you will find it 
  351. easier to use the names described above rather than key numbers. See the 
  352. Reference Tables for an explanation and list of ASCII and key codes. 
  353.  
  354. Some keys are intercepted by OS/2 and are not passed on to 4OS2.  For example, 
  355. Ctrl-S pauses screen output temporarily, and Ctrl-Esc pops up the OS/2 window 
  356. list.  Keys which are intercepted by OS/2 generally cannot be assigned to 
  357. aliases or with key mapping directives, because 4OS2 never receives these 
  358. keystrokes and therefore cannot act on them. 
  359.  
  360. You also may not be able to use certain keys if your keyboard is not 100% 
  361. IBM-compatible or your keyboard driver does not support them.  For example, on 
  362. some systems the F11 and F12 keys are not recognized; others may not support 
  363. unusual combinations like Ctrl-Tab.  These problems are rare; when they do 
  364. occur, they are usually due to OS/2 and not to any problem with 4OS2. 
  365.  
  366.  
  367. ΓòÉΓòÉΓòÉ 4. 16-Bit and 32-Bit Versions of 4OS2 ΓòÉΓòÉΓòÉ
  368.  
  369. 4OS2 comes in two versions:  32-bit (4OS2/32) and 16-bit (4OS2/16).  If you use 
  370. OS/2 version 2.1 or above, you will find that 4OS2/32 offers a few improvements 
  371. and runs a bit faster than 4OS2/16.  Normally, the correct version is selected 
  372. for you automatically by the 4OS2 INSTALL program.  If you are using a 
  373. downloaded copy of 4OS2, see the README.DOC file which came with your copy for 
  374. details on selecting the appropriate files for your system. 
  375.  
  376. Once the proper version is selected during installation, you generally don't 
  377. need to be concerned with which version you are using, as the two versions are 
  378. almost identical.  A few features are available only in the 32-bit version; 
  379. these are marked as such in this help text and in the manuals. 
  380.  
  381. If necessary, you can install the 16-bit or 32-bit version explicitly rather 
  382. than letting the installation program choose for you.  To do so, start the 
  383. installation program (see page 4) and select the Install 16-bit Version or 
  384. Install 32-bit Version option.  These options install only the files which 
  385. differ between the two versions:  4OS2.EXE, SHRALIAS.EXE, 4OS2A.ICO, and 
  386. 4OS2B.ICO. 
  387.  
  388. 4OS2/16 runs under OS/2 1.21, 1.3, 2.0, 2.1, 2.11, and 3.0 (including "OS/2 for 
  389. Windows").  4OS2/32 normally runs only under OS/2 2.1, 2.11, and 3.0 (also 
  390. including "OS/2 for Windows").  You can install it manually for OS/2 2.0 if you 
  391. wish, but some features may not work properly due to problems with 32-bit 
  392. support in some versions of OS/2 2.0. 
  393.  
  394.  
  395. ΓòÉΓòÉΓòÉ 5. ┬áStartup ΓòÉΓòÉΓòÉ
  396.  
  397. Each 4OS2 object on your OS/2 desktop represents a different 4OS2 session.  You 
  398. can configure any of these sessions to run in windowed or full-screen mode, and 
  399. you can set any necessary command line parameters for 4OS2, by adjusting the 
  400. properties of the desktop objects. 
  401.  
  402. To adjust the properties of an object you need to be familiar with how object 
  403. properties are set in your version of OS/2.  For details see your OS/2 
  404. documentation, or the 4OS2 Introduction and Installation Guide. 
  405.  
  406. When you configure a 4OS2 object, place an asterisk [*] in the Program Name 
  407. field, and put any startup options that you want passed to 4OS2 (e.g., 
  408. @inifile) in the Parameters field.  For example: 
  409.  
  410.      Path and file name:  *
  411.      Parameters:          @D:\START\4OS2.INI
  412.      Working directory:   C:\
  413.  
  414. (If 4OS2 is not set up as your default OS/2 shell in CONFIG.SYS, use the full 
  415. path and name for 4OS2.EXE as the program name, rather than the asterisk.) 
  416.  
  417. The 4OS2 command line does not need to contain any information.  When invoked 
  418. with an empty command line, 4OS2 will configure itself from the 4OS2.INI file, 
  419. run 4START, and then display a prompt and wait for you to type a command. 
  420. However, you may add options on the 4OS2 command line to change the way 4OS2 
  421. operates. 
  422.  
  423. 4OS2 recognizes several optional fields on the command line. All of the options 
  424. go on one line.  If you use more than one of these fields, their order is 
  425. important.  The syntax for the command line is: 
  426.  
  427.         [d:\path] [@d:\path\inifile] [//iniline]... [/L] [/LA] [/LD] [/LH] [/S] 
  428.         [/C | /K] [command] 
  429.  
  430.  The options are: 
  431.  
  432.         d:\path:  4OS2 will use this directory and path to set the COMSPEC 
  433.         environment variable for this session.  If this option is not used, 
  434.         COMSPEC is set from the location of 4OS2.EXE.  4OS2 always knows what 
  435.         drive and directory it was started from and can set COMSPEC 
  436.         accordingly.  This option is included only for compatibility with 
  437.         CMD.EXE. 
  438.  
  439.         @d:\path\inifile:  This option sets the path and name of the 4OS2.INI 
  440.         file.  You do not need this option if you aren't using a 4OS2.INI file, 
  441.         or if the file is named 4OS2.INI and is stored in the same subdirectory 
  442.         as 4OS2.EXE or in the root directory of the boot drive. 
  443.  
  444.         //iniline:  This option tells 4OS2 to treat the text appearing between 
  445.         the // and the next space or tab as a 4OS2.INI directive.  The 
  446.         directive should be in the same format as a line in 4OS2.INI, but it 
  447.         may not contain spaces, tabs, or comments.  This option overrides any 
  448.         corresponding directive in your 4OS2.INI file. 
  449.  
  450.         /L, /LA, /LD, and /LH:  These options force 4OS2 to to use a local 
  451.         alias, directory history, and / or command history list.  They can be 
  452.         used to override any LocalAlias=No, LocalDirHistory=No, or 
  453.         LocalHistory=No settings in 4OS2.INI.  This allows you to use global 
  454.         lists as the default, but start a specific 4OS2 session with local 
  455.         lists. See Command History for details on local and global history, 
  456.         Directory History Window for details on local and global directory 
  457.         history, and ALIAS for details on local and global aliases.  /LA forces 
  458.         local aliases, /LD forces local directory history, /LH forces local 
  459.         history, and /L forces all three. 
  460.  
  461.         /S:  This option tells 4OS2 that you do not want it to set up a Ctrl-C 
  462.         / Ctrl-Break handler.  It is included for compatibility with CMD.EXE, 
  463.         but it may cause the system to operate incorrectly if you use this 
  464.         option without other software to handle Ctrl-C and Ctrl-Break. 
  465.  
  466.         [/C | /K] command:  This option tells 4OS2 to run a command when it 
  467.         starts.  The command will be run after 4START has been executed and 
  468.         before any command prompt is displayed.  It can be any valid internal 
  469.         or external command, batch file, or alias; you may include multiple 
  470.         commands by using the command separator.  All other startup options 
  471.         must be placed before the command, because 4OS2 will treat characters 
  472.         after the command as part of the command and not as additional startup 
  473.         options. 
  474.  
  475.         When the command is preceded by a /C, 4OS2 will execute the command and 
  476.         then exit and return to the parent program or the OS/2 desktop without 
  477.         displaying a prompt. 
  478.  
  479.         The /K switch has no effect; using it is the same as placing the 
  480.         command (without a /C or /K) at the end of the startup command line. 
  481.         It is included only for compatibility with CMD.EXE. 
  482.  
  483.  To run a startup batch file for a particular 4OS2 session, include its name 
  484.  (with a path, if the batch file is not in the session's startup directory) as 
  485.  the last item in the Parameters field when you configure the desktop object. 
  486.  That batch file will be executed after any 4START file, but before the first 
  487.  prompt is displayed.  You can use the batch file to set environment variables 
  488.  and execute any other 4OS2 commands. 
  489.  
  490.  You can also execute any internal 4OS2 command, external command, or alias by 
  491.  placing its name in the Parameters field.  For example: 
  492.  
  493.        Path and file name:  *
  494.        Parameters:          D:\STARTOS2.CMD
  495.        Working directory:   C:\
  496.  
  497.  To execute an internal or external command, an alias, or a batch file and then 
  498.  exit (return to the desktop) when it is done, place /C command (rather than 
  499.  just command) as the last item in the Parameters field.  For example: 
  500.  
  501.        Path and file name:  *
  502.        Parameters:          /C COMFILES.BTM
  503.        Working directory:   C:\
  504.  
  505.  
  506. ΓòÉΓòÉΓòÉ 6. The Command Line ΓòÉΓòÉΓòÉ
  507.  
  508. 4OS2 displays a [c:\] prompt when it is waiting for you to enter a command. 
  509. (The actual text depends on the current drive and directory as well as your 
  510. PROMPT settings.)  This is called the command line and the prompt is asking you 
  511. to enter a command, an alias or batch file name, or the instructions necessary 
  512. to begin an application program. 
  513.  
  514. This section explains the features that will help you while you are typing in 
  515. commands, and how keystrokes are interpreted when you enter them at the command 
  516. line.  The keystrokes discussed here are the ones normally used by 4OS2.  If 
  517. you prefer using different keystrokes to perform these functions, you can 
  518. assign new ones with key mapping directives in 4OS2.INI. 
  519.  
  520. The command line features documented in this section are: 
  521.  
  522.             Command-Line Editing 
  523.             Command History and Recall 
  524.             Command History Window 
  525.             Filename Completion 
  526.             Directory History Window 
  527.             Automatic Directory Changes 
  528.             Multiple Commands 
  529.             Command-Line Length Limits 
  530.             Page and File Prompts 
  531.             Conditional Commands 
  532.             Command Grouping 
  533.             Escape Character 
  534.             Critical Errors 
  535.  
  536.  Additional command-line features are documented under Redirection and Piping 
  537.  and File Selection. 
  538.  
  539.  
  540. ΓòÉΓòÉΓòÉ 6.1. Command-Line Editing ΓòÉΓòÉΓòÉ
  541.  
  542. The command line works like a single-line word processor, allowing you to edit 
  543. any part of the command at any time before you press Enter to execute it, or 
  544. Esc to erase it.  The command line extends to a maximum of 1023 characters. 
  545.  
  546. You can use the following editing keys when you are typing a command (the words 
  547. Ctrl and Shift mean to press the Ctrl or Shift key together with the other key 
  548. named): 
  549.  
  550. Cursor Movement Keys: 
  551.  
  552.                        Move the cursor left one character. 
  553.                        Move the cursor right one character. 
  554.         Ctrl           Move the cursor left one word. 
  555.         Ctrl           Move the cursor right one word. 
  556.         Home            Move the cursor to the beginning of the line. 
  557.         End             Move the cursor to the end of the line. 
  558.  
  559.  Insert and Delete: 
  560.  
  561.         Ins             Toggle between insert and overtype mode. 
  562.         Del             Delete the character at the cursor. 
  563.         Backspace       Delete the character to the left of the cursor. 
  564.         Ctrl-L          Delete the word or partial word to the left of the 
  565.                         cursor. 
  566.         Ctrl-R          or Ctrl-Bksp  Delete the word or partial word to the 
  567.                         right of the cursor. 
  568.         Ctrl-Home       Delete from the beginning of the line to the cursor. 
  569.         Ctrl-End        Delete from the cursor to the end of the line. 
  570.         Esc             Delete the entire line. 
  571.         Ctrl-C          or Ctrl-Break  Cancel the command. 
  572.         Enter           Execute the command line. 
  573.  
  574.  4OS2 will prompt for additional command-line text when you include the escape 
  575.  character as the very last character of a typed command line.  The default 
  576.  escape character is the caret [^].  For example: 
  577.  
  578.           [c:\] echo The quick brown fox jumped over the lazy^
  579.           More? sleeping dog. > alphabet
  580.  
  581.  Sometimes you may want to enter one of the above keystrokes on the command 
  582.  line instead of performing the key's usual action.  For example, suppose you 
  583.  have a program that requires a Ctrl-R character on its command line.  Normally 
  584.  you couldn't type this keystroke at the prompt, because it would be 
  585.  interpreted as a "Delete word right" command. 
  586.  
  587.  To get around this problem, use the special keystroke Alt-255. You enter 
  588.  Alt-255 by holding down the Alt key while you type 255 on the numeric keypad, 
  589.  then releasing the Alt key (you must use the number keys on the numeric pad; 
  590.  the row of keys at the top of your keyboard won't work).  This forces 4OS2 to 
  591.  interpret the next keystroke literally and places it on the command line, 
  592.  ignoring any special meaning it would normally have as a command- line editing 
  593.  or history keystroke.  You can use Alt-255 to suppress the normal meaning of 
  594.  command-line editing keystrokes even if they have been reassigned with key 
  595.  mapping directives in the .INI file, and Alt-255 itself can be reassigned with 
  596.  the CommandEscape directive. 
  597.  
  598.  If you want your input at the command line to be in a different color from 
  599.  4OS2's prompts or output, you can use the InputColors directive in your .INI 
  600.  file. 
  601.  
  602.  Most of the command-line editing capabilities are also available when a 4OS2 
  603.  command prompts you for a line of input.  For example, you can use the 
  604.  command-line editing keys when DESCRIBE prompts for a file description, when 
  605.  INPUT prompts for input from an alias or batch file, or when LIST prompts you 
  606.  for a search string. 
  607.  
  608.  
  609. ΓòÉΓòÉΓòÉ 6.2. Command History and Recall ΓòÉΓòÉΓòÉ
  610.  
  611. Command History Keys: 
  612.  
  613.                        Recall the previous (or most recent) command, or the 
  614.                         most recent command that matches a partial command 
  615.                         line. 
  616.                        Recall the next (or oldest) command, or the oldest 
  617.                         command that matches a partial command line. 
  618.         F3              Fill in the rest of the command line from the previous 
  619.                         command, beginning at the current cursor position. 
  620.         Ctrl-D          Delete the currently displayed history list entry, 
  621.                         erase the command line, and display the previous 
  622.                         matching history list entry. 
  623.         Ctrl-E          Display the last entry in the history list. 
  624.         Ctrl-K          Save the current command line in the history list 
  625.                         without executing it, and then clear the command line. 
  626.         Ctrl-Enter      Copy the current command line to the end of the history 
  627.                         list even it has not been altered. 
  628.         @               As the first character in a line:  Do not save the 
  629.                         current line in the history list when it is executed, 
  630.                         and do not store it in the CMDLINE environment 
  631.                         variable. 
  632.  
  633.  Use the  key repeatedly to scan back through the history list.  When the 
  634.  desired command appears, press Enter to execute it again.  After you have 
  635.  found a command, you can edit it before pressing Enter. 
  636.  
  637.  The history list is "circular".  If you move to the last command in the list 
  638.  and then press the down arrow one more time, you'll see the first command in 
  639.  the list.  Similarly, if you move to the first command in the list and then 
  640.  press the up arrow one more time, you'll see the last command in the list. 
  641.  
  642.  You can search the command history list to find a previous command quickly 
  643.  using command completion.  Just enter the first few characters of the command 
  644.  you want to find and press . You only need to enter enough characters to 
  645.  identify the command that you want to find.  If you press the  key a second 
  646.  time, you will see the previous command that matches.  The system will beep if 
  647.  there are no matching commands.  The search process stops as soon as you type 
  648.  one of the editing keys, whether or not the line is changed.  At that point, 
  649.  the line you're viewing becomes the new line to match if you press  again. 
  650.  
  651.  You can specify the size of the command history list with the History 
  652.  directive in the .INI file.  When the list is full, the oldest commands are 
  653.  discarded to make room for new ones.  You can also use the HistMin directive 
  654.  in the .INI file to enable or disable history saves and to specify the 
  655.  shortest command line that will be saved. 
  656.  
  657.  You can prevent any command line from being saved in the history by beginning 
  658.  it with an at sign [@]. 
  659.  
  660.  Use Ctrl-Enter to organize the history list for repetitive tasks.  Instead of 
  661.  searching through the command history for the next command in a sequence, you 
  662.  can place all of the necessary commands next to each other and make them 
  663.  easier to repeat. 
  664.  
  665.  When you execute a command from the history, that command remains in the 
  666.  history list in its original position.  The command is not copied to the end 
  667.  of the list (unless you modify it).  If you want each command to be copied to 
  668.  the end of the list when it is re- executed, set HistCopy to Yes in your .INI 
  669.  file. 
  670.  
  671.  Local and Global Command History 
  672.  
  673.  The command history can be stored in either a "local" or "global" list. 
  674.  
  675.  With a local history list, any changes made to the history will only affect 
  676.  the current copy of 4OS2.  They will not be visible in other shells, or other 
  677.  sessions. 
  678.  
  679.  With a global history list, all copies of 4OS2 will share the same command 
  680.  history, and any changes made to the history in one copy will affect all other 
  681.  copies.  Global lists are the default for 4OS2. 
  682.  
  683.  You can control the type of history list with the LocalHistory directive in 
  684.  the .INI file, and with the /L and /LH options of the START command. 
  685.  
  686.  If you select a global history list for 4OS2 you can share the history among 
  687.  all copies of 4OS2 running in any session.  When you close all 4OS2 sessions, 
  688.  the memory for the global history list is released, and a new, empty history 
  689.  list is created the next time you start 4OS2. 
  690.  
  691.  If you want the history list to be retained in memory even when no command 
  692.  processor session is running, see the SHRALIAS command, which retains the 
  693.  global alias, command history, and directory history lists. 
  694.  
  695.  SHRALIAS retains the history list in memory, but cannot preserve it when OS/2 
  696.  itself is shut down.  To save the history list when restarting OS/2, you must 
  697.  store it in a file and reload it after the system restarts.  For details on 
  698.  how to do so, see the HISTORY command. 
  699.  
  700.  
  701. ΓòÉΓòÉΓòÉ 6.3. Command History Window ΓòÉΓòÉΓòÉ
  702.  
  703. Command History Window Keys: 
  704.  
  705.         PgUp            (from the command line) Open the command history 
  706.                         window. 
  707.          or PgDn 
  708.                        Scroll the display up one line. 
  709.                        Scroll the display down one line. 
  710.                        Scroll the display left 4 columns. 
  711.                        Scroll the display right 4 columns. 
  712.         PgUp            (inside the window) Scroll the display up one page. 
  713.         PgDn            (inside the window) Scroll the display down one page. 
  714.         Ctrl-PgUp       Go to the beginning of the history list. 
  715.          or Home 
  716.         Ctrl-PgDn       Go to the end of the history list. 
  717.          or End 
  718.         Ctrl-D          Delete the selected line from the history list. 
  719.         Enter           Execute the selected line. 
  720.         Ctrl-Enter      Move the selected line to the command line for editing. 
  721.  
  722.  You can view the command history in a scrollable command history window, and 
  723.  select the command to modify or re-execute from those displayed in the window. 
  724.  To activate the command history window press PgUp or PgDn at the command line. 
  725.  A window will appear in the upper right corner of the screen, with the command 
  726.  you most recently executed marked with a highlight. (If you just finished 
  727.  re-executing a command from the history, then the next command in sequence 
  728.  will be highlighted.) 
  729.  
  730.  Once you have selected a command in the history window, press Enter to execute 
  731.  it immediately, or Ctrl-Enter to move the line to the prompt for editing (you 
  732.  cannot edit the line directly in the history window). 
  733.  
  734.  You can bring up a "filtered" history window by typing some characters on the 
  735.  command line, then pressing PgUp or PgDn. Only those commands matching the 
  736.  typed characters will be displayed in the window. 
  737.  
  738.  You can control the position and size of the history window with configuration 
  739.  directives in 4OS2.INI.  You can also change the keys used in the window with 
  740.  key mapping directives in the .INI file. 
  741.  
  742.  
  743. ΓòÉΓòÉΓòÉ 6.4. Filename Completion ΓòÉΓòÉΓòÉ
  744.  
  745. Filename Completion Keys: 
  746.  
  747.         F8                  Get the previous matching filename. 
  748.          or Shift-Tab 
  749.         F9                  Get the next matching filename. 
  750.          or Tab 
  751.         F10                 Keep the current matching filename and display the 
  752.                             next matching name immediately after the current 
  753.                             one. 
  754.  
  755.  Filename completion can help you by filling in a complete file name on the 
  756.  command line when you only remember part of the name.  For example, if you 
  757.  know the name of a file begins AU but you can't remember the rest of the name, 
  758.  type: 
  759.  
  760.           [c:\] copy au
  761.  
  762.  and then press the Tab key or F9 key.  4OS2 will search the current directory 
  763.  for filenames that begin AU and insert the first one onto the command line in 
  764.  place of the AU that you typed. 
  765.  
  766.  If this is the file that you want, simply complete the command.  If 4OS2 
  767.  didn't find the file that you were looking for, press Tab or F9 again to 
  768.  substitute the next filename that begins with AU.  When there are no more 
  769.  filenames that match your pattern, the system will beep each time you press 
  770.  Tab or F9. 
  771.  
  772.  If you go past the filename that you want, press Shift-Tab or F8 to back up 
  773.  and return to the previous matching filename. After you back up to the first 
  774.  filename, the system will beep each time you press Shift-Tab or F8. 
  775.  
  776.  If you want to enter more than one matching filename on the same command line, 
  777.  press F10 when each desired name appears.  This will keep that name and place 
  778.  the next matching filename after it on the command line.  You can then use Tab 
  779.  (or F9) and Shift-Tab (or F8) to move through the remaining matching files. 
  780.  
  781.  The pattern you use for matching may contain any valid filename characters, as 
  782.  well as wildcard characters and extended wildcards.  For example, you can copy 
  783.  the first matching .TXT file by typing 
  784.  
  785.           [c:\] copy *.txt
  786.  
  787.  and then pressing Tab. 
  788.  
  789.  If you don't specify part of a filename before pressing Tab, the matching 
  790.  pattern will be *.*.  If you type a filename without an extension, 4OS2 will 
  791.  add *.* to the name.  It will also place a "*" after a partial extension.  If 
  792.  you are typing a group of file names in an include list, the part of the 
  793.  include list at the cursor will be used as the pattern to match. 
  794.  
  795.  When filename completion is used at the start of the command line, it will 
  796.  only match directories, executable files, and files with executable 
  797.  extensions, since these are the only file names that it makes sense to use at 
  798.  the start of a command.  If a directory is found, a "\" will be appended to it 
  799.  to enable an automatic directory change. 
  800.  
  801.  When using filename completion after typing a command, a "\" will be appended 
  802.  to the end of each directory name if AppendToDir is set to "Yes" in 4OS2.INI. 
  803.  
  804.  Filename Completion Window 
  805.  
  806.  You can also view filenames in a scrollable filename completion window and 
  807.  select the file you want to work with.  To activate the window, press F7 or 
  808.  Ctrl-Tab at the command line.  You will see a window in the upper-right corner 
  809.  of the screen, with the names of files that match any partial filename you 
  810.  have entered on the command line.  If you haven't yet entered a file name, the 
  811.  window will contain the name of all files in the current directory. (Ctrl-Tab 
  812.  will work only if your keyboard and keyboard driver support it.  If it does 
  813.  not work on your system, use F7 instead.) 
  814.  
  815.  Filename Completion Window Keys: 
  816.  
  817.         F7                  (from the command line)  Open the filename 
  818.                             completion window. 
  819.          or Ctrl-Tab 
  820.                            Scroll the display up one line. 
  821.                            Scroll the display down one line. 
  822.                            Scroll the display left 4 columns. 
  823.                            Scroll the display right 4 columns. 
  824.         PgUp                Scroll the display up one page. 
  825.         PgDn                Scroll the display down one page. 
  826.         Ctrl-PgUp           Go to the beginning of the filename list. 
  827.          or Home 
  828.         Ctrl-PgDn           Go to the end of the filename list. 
  829.          or End 
  830.         Enter               Insert the selected filename into the command line. 
  831.  
  832.  
  833. ΓòÉΓòÉΓòÉ 6.5. ┬áDirectory History Window ΓòÉΓòÉΓòÉ
  834.  
  835. Directory History Window Keys: 
  836.  
  837.         Ctrl-PgUp       (from the command line) Open the directory history 
  838.                         window. 
  839.          or Ctrl-PgDn 
  840.                        Scroll the display up one line. 
  841.                        Scroll the display down one line. 
  842.                        Scroll the display left 4 columns. 
  843.                        Scroll the display right 4 columns. 
  844.         PgUp            Scroll the display up one page. 
  845.         PgDn            Scroll the display down one page. 
  846.         Ctrl-PgUp       Go to the beginning of the directory list. 
  847.          or Home 
  848.         Ctrl-PgDn       Go to the end of the directory list. 
  849.          or End 
  850.         Ctrl-D          Delete the selected line from the directory list. 
  851.         Enter           Change to the selected drive and directory. 
  852.         Ctrl-Enter      Move the selected line to the command line for editing. 
  853.  
  854.  Every time you change to a new directory or drive, the current directory 
  855.  directory is recorded in an internal directory history list. You can set the 
  856.  size of the list with the DirHistory directive in 4OS2.INI.  As new entries 
  857.  are added, old entries are deleted from the list.  Directory changes are 
  858.  recorded whether you make them from the command line with the CD, CDD, PUSHD, 
  859.  or POPD commands, with an automatic directory change, or by typing a new drive 
  860.  letter followed by a colon. Directories are recorded whether you change from 
  861.  one to another at the command line, from within a batch file, or from within 
  862.  an alias.  In order to conserve space, each directory name is recorded just 
  863.  once in the directory history, even if you move into and out of that directory 
  864.  several times. 
  865.  
  866.  You can view the directory history from the scrollable directory history 
  867.  window and change to any drive and directory on the list. To activate the 
  868.  directory history window, press Ctrl-PgUp or Ctrl-PgDn at the command line. 
  869.  You can then select a new directory with the Enter key. 
  870.  
  871.  See also Local and Global Directory History. 
  872.  
  873.  
  874. ΓòÉΓòÉΓòÉ 6.5.1. Local and Global Directory History ΓòÉΓòÉΓòÉ
  875.  
  876. The directory history can be stored in either a "local" or "global" list. 
  877.  
  878. With a local directory history list, any changes made to the list will only 
  879. affect the current copy of the command processor.  They will not be visible in 
  880. other shells, or other sessions. 
  881.  
  882. With a global list, all copies of the command processor will share the same 
  883. directory history, and any changes made to the list in one copy will affect all 
  884. other copies. 
  885.  
  886. You can control the type of directory history list with the LocalDirHistory 
  887. directive in 4OS2.INI, and with the /L and /LD options of the START command. 
  888.  
  889. There is no fixed rule for deciding whether to use a local or global directory 
  890. history list.  Depending on your work style, you may find it most convenient to 
  891. use one type, or a mixture of types in different sessions or shells.  We 
  892. recommend that you start with the default, then modify it if you find a 
  893. situation where the default is not convenient. 
  894.  
  895. If you select a global directory list, you can share the list among all copies 
  896. of the command processor running in any session.  When you close all 4OS2 
  897. sessions, the memory for the global directory history list is released, and a 
  898. new, empty list is created the next time you start 4OS2. 
  899.  
  900. If you want the list to be retained in memory even when no command processor 
  901. session is running, see the SHRALIAS command, which retains the global alias, 
  902. command history, and directory history lists.  SHRALIAS retains the directory 
  903. history list in memory, but cannot preserve it when OS/2 itself is shut down. 
  904. Take Command always starts with an empty directory history after the system is 
  905. restarted. 
  906.  
  907.  
  908. ΓòÉΓòÉΓòÉ 6.6. Automatic Directory Changes ΓòÉΓòÉΓòÉ
  909.  
  910. The automatic directory change feature gives you a quick method for changing 
  911. directories.  You can use an automatic directory change in place of the CD or 
  912. CDD command.  To do so, simply type the name of the directory you want to 
  913. change to at the prompt, with a backslash [\] at the end.  For example: 
  914.  
  915.         [c:\] 4os2\
  916.         [c:\4os2]
  917.  
  918. This feature can make directory changes very simple when it's combined with 
  919. CDPATH, a list of directories for the CD and CDD commands to search if the 
  920. directory you name does not exist below the current directory.  For example, 
  921. suppose CDPATH is set to C:\;D:\;E:\, and the directory WIN exists on drive E:. 
  922. You can change to this directory with a single word on the command line: 
  923.  
  924.         [c:\4os2] win\
  925.         [e:\win]
  926.  
  927. In executing the command shown above, 4OS2 first looks for a WIN subdirectory 
  928. of the current directory, i.e., C:\4OS2\WIN.  If no such directory exists it 
  929. looks for a WIN subdirectory in every directory in the CDPATH list, and changes 
  930. to the first one it finds. 
  931.  
  932. Internally, automatic directory changes use the CDD command, so the text before 
  933. the backslash can include a drive letter, a full path, or a partial path. 
  934. Commands like "....\" can be used to move up the directory tree quickly (see 
  935. Extended Parent Directory Names). Automatic directory changes save the current 
  936. directory, so it can be recalled with a "CDD -" or "CD -" command. 
  937.  
  938.  
  939. ΓòÉΓòÉΓòÉ 6.7. Multiple Commands ΓòÉΓòÉΓòÉ
  940.  
  941. You can type several commands on the same command line, separated by an 
  942. ampersand [&].  For example, if you know you want to copy all of your .TXT 
  943. files to drive A: and then run CHKDSK to be sure that drive A's file structure 
  944. is in good shape, you could enter the following command: 
  945.  
  946.         [c:\] copy *.txt a: & chkdsk a:
  947.  
  948. You may put as many commands on the command line as you wish, as long as the 
  949. total length of the command line does not exceed 1023 characters. 
  950.  
  951. You can use multiple commands in batch files and alias definitions as well as 
  952. from the command line. 
  953.  
  954. If you don't like using the default command separator, you can pick another 
  955. character using the SETDOS /C command or the CommandSep directive in the .INI 
  956. file.  If you plan to share aliases or batch files between 4DOS, 4OS2, and 
  957. 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details about choosing 
  958. compatible command separators for two or more products. 
  959.  
  960.  
  961. ΓòÉΓòÉΓòÉ 6.8. Command-Line Length Limits ΓòÉΓòÉΓòÉ
  962.  
  963. When you first enter a command at the prompt or in an alias or batch file, it 
  964. can be up to 1,023 characters long. 
  965.  
  966. As 4OS2 scans the command line and substitutes the contents of aliases and 
  967. environment variables for their names, the line usually gets longer.  This 
  968. expanded line is stored in an internal buffer which allows each individual 
  969. command to grow to 1,023 characters during the expansion process.  In addition, 
  970. if you have multiple commands on a single line, during expansion the entire 
  971. line can grow to as much as 2,047 characters.  If your use of aliases or 
  972. environment variables causes the command line to exceed either of these limits 
  973. as it is expanded, you will see an error message and the remainder of the line 
  974. will not be executed. 
  975.  
  976.  
  977. ΓòÉΓòÉΓòÉ 6.9. Page and File Prompts ΓòÉΓòÉΓòÉ
  978.  
  979. Several 4OS2 commands can generate prompts, which wait for you to press a key 
  980. to view a new page or to perform a file activity. 
  981.  
  982. When 4OS2 is displaying information in page mode, for example with a DIR /P or 
  983. SET /P command, it displays the message 
  984.  
  985.         Press Esc to Quit or any other key to continue...
  986.  
  987. At this prompt, you can press Esc, Ctrl-C, or Ctrl- Break if you want to quit 
  988. the command.  You can press almost any other key to continue with the command 
  989. and see the next page of information. 
  990.  
  991. During file processing, if you have activated prompting with a command like DEL 
  992. /P, you will see this prompt before processing every file: 
  993.  
  994.         Y/N/R ?
  995.  
  996. You can answer this prompt by pressing "Y" for "Yes, process this file;"  "N" 
  997. for "No, do not process this file;" "R" for "process the Remainder of the files 
  998. without further prompting; or "Esc" for "cancel further processing for this 
  999. argument."  You can also press Ctrl-C or Ctrl-Break at this prompt to cancel 
  1000. the remainder of the command. 
  1001.  
  1002.  
  1003. ΓòÉΓòÉΓòÉ 6.10. Conditional Commands ΓòÉΓòÉΓòÉ
  1004.  
  1005. Conditional commands allow you to perform tasks based upon the previous 
  1006. command's exit code.  Many programs return a 0 if they are successful and a 
  1007. non-zero value if they encounter an error. 
  1008.  
  1009. If you separate two commands by && (AND), the second command will be executed 
  1010. only if the first returns an exit code of 0.  For example, the following 
  1011. command will only erase files if the BACKUP operation succeeds: 
  1012.  
  1013.         [c:\] backup c:\ a: && del c:\*.bak;*.lst
  1014.  
  1015. If you separate two commands by || (OR), the second command will be executed 
  1016. only if the first returns a non-zero exit code. For example, if the following 
  1017. BACKUP operation fails, then ECHO will display a message: 
  1018.  
  1019.         [c:\] backup c:\ a: || echo Error in the backup!
  1020.  
  1021. All internal commands return an exit code, but not all external programs do. 
  1022. Conditional commands will behave unpredictably if you use them with external 
  1023. programs which do not return an explicit exit code. 
  1024.  
  1025.  
  1026. ΓòÉΓòÉΓòÉ 6.11. Command Grouping ΓòÉΓòÉΓòÉ
  1027.  
  1028. Command grouping allows you to logically group a set of commands together by 
  1029. enclosing them in parentheses.  The parentheses are similar in function to the 
  1030. BEGIN and END block statements in some programming languages. 
  1031.  
  1032. There are two primary uses for command grouping.  One is to execute multiple 
  1033. commands in a place where normally only a single command is allowed.  For 
  1034. example, suppose you want to copy then rename all the .WKQ files on drives A: 
  1035. and B: using the FOR command.  You could do it like this: 
  1036.  
  1037.         [c:\] for %drv in (A B) do copy %drv:*.wkq d:\wksave\
  1038.         [c:\] for %drv in (A B) do ren %drv:*.wkq *.old
  1039.  
  1040. But with command grouping you can do the same thing in one command (enter this 
  1041. on one line): 
  1042.  
  1043.         [c:\] for %drv in (A B) do (copy %drv:*.wkq
  1044.              d:\wksave\ & ren %drv:*.wkq *.sav)
  1045.  
  1046. The COPY and REN commands enclosed in the parentheses appear to FOR as if they 
  1047. were a single command, so both commands are executed for every element of the 
  1048. FOR list. 
  1049.  
  1050. You can also use command grouping to redirect input or output for several 
  1051. commands without repeatedly using the redirection symbols.  For example, 
  1052. consider the following batch file fragment which uses the ECHO command to 
  1053. create a file (with >), and to append to the file (with >>): 
  1054.  
  1055.         echo Data files %_date > filelist
  1056.         dir *.dat >> filelist
  1057.         echo. >> filelist
  1058.         echo Text files %_date >> filelist
  1059.         dir *.txt >> filelist
  1060.  
  1061. Using command grouping, these commands can be written much more simply.  Enter 
  1062. this example on one line: 
  1063.  
  1064.         (echo Data files %_date & dir *.dat & echo. & echo Text files
  1065.         %_date & dir *.txt) > filelist
  1066.  
  1067. The redirection, which appears outside the parentheses, applies to all the 
  1068. commands within the parentheses.  Because the redirection is performed only 
  1069. once, the commands will run slightly faster than if each command was entered 
  1070. separately.  The same approach can be used for input redirection and for 
  1071. piping. 
  1072.  
  1073. You can also use command grouping in a batch file or at the prompt to split 
  1074. commands over several lines.  This last example is like the redirection example 
  1075. above, but is entered at the prompt.  4OS2 displays a "More?" prompt after each 
  1076. incomplete line: 
  1077.  
  1078.         [c:\] (echo Data files %_date
  1079.         More? dir *.dat
  1080.         More? echo.
  1081.         More? echo Text files %_date
  1082.         More? dir *.txt) > filelist
  1083.         [c:\]
  1084.  
  1085. You cannot use the DO command inside a command group. 
  1086.  
  1087.  
  1088. ΓòÉΓòÉΓòÉ 6.12. Escape Character ΓòÉΓòÉΓòÉ
  1089.  
  1090. 4OS2 recognizes a user-definable escape character.  This character gives the 
  1091. following character a special meaning; it is not the same as the ASCII ESC that 
  1092. is often used in ANSI and printer control sequences. 
  1093.  
  1094. The default escape character is a caret [^]. 
  1095.  
  1096. If you don't like using the default escape character, you can pick another 
  1097. character using the SETDOS /E command or the EscapeChar directive in your .INI 
  1098. file.  If you plan to share aliases or batch files between 4DOS, 4OS2, and 
  1099. 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details about choosing 
  1100. compatible escape characters for two or more products. 
  1101.  
  1102. Eight special characters are recognized when they are preceded by the escape 
  1103. character.  The combination of the escape character and one of these characters 
  1104. is translated to a single character, as shown below.  These are useful for 
  1105. redirecting codes to the printer; ^e is also useful to generate ANSI "escape 
  1106. sequences" in your PROMPT, ECHO, or other output commands; and ^r can be used 
  1107. in keystroke aliases.  The special characters which can follow the escape 
  1108. character are: 
  1109.  
  1110.         b   backspace 
  1111.         c   comma 
  1112.         e   the ASCII ESC character (ASCII 27) 
  1113.         f   form feed 
  1114.         n   line feed 
  1115.         r   carriage return 
  1116.         s   space 
  1117.         t   tab character 
  1118.  
  1119.  If you follow the escape character with any other character, the escape 
  1120.  character is removed and the second character is copied directly to the 
  1121.  command line.  This allows you to suppress the normal meaning of special 
  1122.  characters (such as ? * / \ | " ` > < and &). 
  1123.  
  1124.  For example, to send a form feed followed by the sequence ESC Y to the 
  1125.  printer, you can use this command: 
  1126.  
  1127.           [c:\] echos ^f^eY > prn
  1128.  
  1129.  
  1130. ΓòÉΓòÉΓòÉ 6.13. Critical Errors ΓòÉΓòÉΓòÉ
  1131.  
  1132. OS/2 watches for physical errors during input and output operations.  Physical 
  1133. errors are those due to hardware problems, such as trying to read a floppy disk 
  1134. while the drive door is open. 
  1135.  
  1136. These errors are called critical errors because OS/2, 4OS2, or your application 
  1137. program cannot proceed until the error is resolved. 
  1138.  
  1139. When a critical error occurs, you will see a popup window asking you to choose 
  1140. an error handling option.  The message comes from OS/2, and will typically 
  1141. offer you four choices: 
  1142.  
  1143.         Return error code to program.  Tell the program that the operation 
  1144.         failed.  This option returns an error code to 4OS2 or to the 
  1145.         application program that was running when the error occurred.  4OS2 
  1146.         generally stops the current command when an operation fails. 
  1147.  
  1148.         End program/command/operation.  Choose this option to stop the program 
  1149.         that was running when the error occurred.  Choosing this option after 
  1150.         an error in the 16-bit version of 4OS2 will abort the command, but not 
  1151.         4OS2 itself.  Choosing it after an error in the 32-bit version of 4OS2 
  1152.         will abort both the command and 4OS2. 
  1153.  
  1154.         Retry command or operation.  Choose this option if you have corrected 
  1155.         the problem. 
  1156.  
  1157.         Display help.  Display further information on the error. 
  1158.  
  1159.  
  1160. ΓòÉΓòÉΓòÉ 7. Redirection and Piping ΓòÉΓòÉΓòÉ
  1161.  
  1162. This section covers redirection and piping.  You can use these features to 
  1163. change how 4OS2 and some application programs handle input and output. 
  1164.  
  1165. Internal commands and many external programs get their input from the 
  1166. computer's standard input device and send their output to the standard output 
  1167. device.  Some programs also send special messages to the standard error device. 
  1168. Normally, the keyboard is used for standard input and the video screen for both 
  1169. standard output and standard error.  Redirection and piping allow you to change 
  1170. these assignments temporarily. 
  1171.  
  1172. Redirection 
  1173.  
  1174. Redirection assigns standard input, standard output, and standard error to a 
  1175. device like the printer or serial port, or to a file. 
  1176.  
  1177. Redirection always applies to a specific command, and lasts only for the 
  1178. duration of that command.  When the command is finished, the assignments for 
  1179. standard input, standard output, and standard error revert to whatever they 
  1180. were before the command. 
  1181.  
  1182. Here are the standard redirection options supported by 4OS2 (see below for 
  1183. additional redirection options using numeric file handles): 
  1184.  
  1185.         < filename          To get input from a file or device instead of from 
  1186.                             the keyboard 
  1187.         > filename          Redirect standard output to a file or device 
  1188.         >& filename         Redirect standard output and standard error to a 
  1189.                             file or device 
  1190.         >&> filename        Redirect standard error only to a file or device 
  1191.  
  1192.  To use redirection, place the redirection symbol and filename at the end of 
  1193.  the command line, after the command name and any parameters.  For example, to 
  1194.  redirect the output of the DIR command to a file called DIRLIST, you could use 
  1195.  a command line like this: 
  1196.  
  1197.           [c:\] dir /b *.dat > dirlist
  1198.  
  1199.  You can use both input and output redirection for the same command, if both 
  1200.  are appropriate: 
  1201.  
  1202.           [c:\] sort < dirlist > dirlist.srt
  1203.  
  1204.  If you redirect the output of a single internal command like DIR, the 
  1205.  redirection ends automatically when that command is done.  If you start a 
  1206.  batch file with redirection, all of the batch file's output is redirected, and 
  1207.  redirection ends when the batch file is done.  Similarly, if you use 
  1208.  redirection at the end of a command group, all of the output from the command 
  1209.  group is redirected, and redirection ends when the command group is done. 
  1210.  
  1211.  If you want to append output to the end of an existing file, rather than 
  1212.  creating a new file, replace the first ">" in the output redirection symbol 
  1213.  with ">>" (use >>, >>&, and >>&>). 
  1214.  
  1215.  When output is directed to a file with >, >&, or >&>, if the file already 
  1216.  exists, it will be overwritten.  You can protect existing files by using the 
  1217.  SETDOS /N1 command or the NoClobber directive in the .INI file. 
  1218.  
  1219.  When output is appended to a file with >>, >>&, or >>&>, the file will be 
  1220.  created if it doesn't already exist. Setting NoClobber will also prevent the 
  1221.  creation of a new file. 
  1222.  
  1223.  You can temporarily override the current setting of NoClobber by using an 
  1224.  exclamation mark [!] after the redirection symbol. For example, to redirect 
  1225.  the output of DIR to the file DIROUT, and allow overwriting of any existing 
  1226.  file despite the NoClobber setting: 
  1227.  
  1228.           [c:\] dir >! dirout
  1229.  
  1230.  Redirection is fully nestable.  For example, you can invoke a batch file and 
  1231.  redirect all of its output to a file or device.  Output redirection on a 
  1232.  command within the batch file will take effect for that command only; when the 
  1233.  command is completed, output will revert to the redirected output file or 
  1234.  device in use for the batch file as a whole. 
  1235.  
  1236.  You can use redirection if you need to create a zero-byte file.  To do so, 
  1237.  enter  >filename as a command, with no actual command before the > character. 
  1238.  
  1239.  In addition to the standard redirection options, 4OS2 also supports the OS/2 
  1240.  CMD.EXE syntax: 
  1241.  
  1242.         n>file      Redirect handle n to the named file 
  1243.         n>&m        Redirect handle n to the same place as handle m 
  1244.  
  1245.  [n] and [m] are one-digit file handles between 0 and 9.  You may not put any 
  1246.  spaces between the n and the >, or between the >, &, and m in the second form. 
  1247.  OS/2 interprets "0" as standard input, "1" as standard output, and "2" as 
  1248.  standard error.  Handles 3 to 9 will probably not be useful unless you have an 
  1249.  application which uses those handles for a specific, documented purpose, or 
  1250.  have opened a file with the %@FILEOPEN variable function and the file handle 
  1251.  is between 3 and 9. 
  1252.  
  1253.  Piping 
  1254.  
  1255.  You can create a "pipe" to send the standard output of one command to the 
  1256.  standard input of another command: 
  1257.  
  1258.         command1 | command2             Send the standard output of command1 to 
  1259.                                         the standard input of command2 
  1260.         command1 |& command2            Send the standard output and standard 
  1261.                                         error of command1 to the standard input 
  1262.                                         of command2 
  1263.  
  1264.  For example, to take the output of the SET command (which displays a list of 
  1265.  your environment variables and their values) and pipe it to the SORT utility 
  1266.  to generate a sorted list, you would use the command: 
  1267.  
  1268.           [c:\] set | sort
  1269.  
  1270.  To do the same thing and then pipe the sorted list to the internal LIST 
  1271.  command for full-screen viewing: 
  1272.  
  1273.           [c:\] set | sort | list /s
  1274.  
  1275.  The TEE and Y commands are "pipe fittings" which add more flexibility to 
  1276.  pipes. 
  1277.  
  1278.  Like redirection, pipes are fully nestable.  For example, you can invoke a 
  1279.  batch file and send all of its output to another command with a pipe.  A pipe 
  1280.  on a command within the batch file will take effect for that command only; 
  1281.  when the command is completed, output will revert to the pipe in use for the 
  1282.  batch file as a whole. 
  1283.  
  1284.  4OS2 implements pipes by starting a new process for the receiving program 
  1285.  instead of using temporary files.  The sending and receiving programs run 
  1286.  simultaneously; the sending program writes to the pipe and the receiving 
  1287.  program reads from the pipe.  When the receiving program finishes reading and 
  1288.  processing the piped data, it is ended automatically. 
  1289.  
  1290.  When you use pipes with 4OS2 make sure you think about any possible 
  1291.  consequences that can occur from using a separate process to run the receiving 
  1292.  program. 
  1293.  
  1294.  
  1295. ΓòÉΓòÉΓòÉ 8. File Selection ΓòÉΓòÉΓòÉ
  1296.  
  1297. Most internal commands (like COPY, DIR, etc.) work on a file or a group of 
  1298. files.  Besides typing the exact name of the file you want to work with, you 
  1299. can use several shorthand forms for naming or selecting files. 
  1300.  
  1301. The features explained in this section apply to 4OS2 commands only, and 
  1302. generally can not be used to pass file names to external programs unless those 
  1303. programs were specifically written to support these features. 
  1304.  
  1305. The file selection features are: 
  1306.  
  1307.             Extended Parent Directory Names 
  1308.             Wildcards 
  1309.             Date, Time, and Size Ranges 
  1310.             Multiple Filenames 
  1311.             Include Lists 
  1312.             Executable Extensions 
  1313.  
  1314.  
  1315. ΓòÉΓòÉΓòÉ 8.1. Extended Parent Directory Names ΓòÉΓòÉΓòÉ
  1316.  
  1317. 4OS2 allows you to extend the traditional syntax for naming the parent 
  1318. directory, by adding additional [.] characters.  Each additional [.] represents 
  1319. an additional directory level above the current directory.  For example, 
  1320. .\FILE.DAT refers to a file in the current directory, ..\FILE.DAT refers to a 
  1321. file one level up (in the parent directory), and ...\FILE.DAT refers to a file 
  1322. two levels up (in the parent of the parent directory).  If you are in the 
  1323. C:\DATA\FINANCE\JANUARY directory and want to copy the file LETTERS.DAT from 
  1324. the directory C:\DATA to drive A: 
  1325.  
  1326.         [C:\DATA\FINANCE\JANUARY] copy ...\LETTERS.DAT A:
  1327.  
  1328.  
  1329. ΓòÉΓòÉΓòÉ 8.2. Wildcards ΓòÉΓòÉΓòÉ
  1330.  
  1331. Wildcards let you specify a file or group of files by typing a partial 
  1332. filename.  The appropriate directory is scanned to find all of the files that 
  1333. match the partial name you have specified. 
  1334.  
  1335. There are two wildcard characters, the asterisk [*] and the question mark [?], 
  1336. plus a special method of specifying a range of permissible characters. 
  1337.  
  1338. An asterisk [*] in a filename means "any zero or more characters in this 
  1339. position."  For example, this command will display a list of all files in the 
  1340. current directory: 
  1341.  
  1342.         [c:\] dir *.*
  1343.  
  1344. If you want to see all of the files with a .TXT extension, you could type this: 
  1345.  
  1346.         [c:\] dir *.txt
  1347.  
  1348. If you know that the file you are looking for has a base name that begins with 
  1349. ST and an extension that begins with .D, you can find it this way.  Filenames 
  1350. such as STATE.DAT, STEVEN.DOC, and ST.D will all be displayed: 
  1351.  
  1352.         [c:\] dir st*.d*
  1353.  
  1354. With 4OS2, you can also use the asterisk to match filenames with specific 
  1355. letters somewhere inside the name.  The following example will display any file 
  1356. with a .TXT extension that has the letters AM together anywhere inside its base 
  1357. name.  It will, for example, display AMPLE.TXT, STAMP.TXT, CLAM.TXT, and AM.TXT 
  1358.  
  1359.         [c:\] dir *am*.txt
  1360.  
  1361. A question mark [?] matches any single filename character.  You can put the 
  1362. question mark anywhere in a filename and use as many question marks as you 
  1363. need.  The following example will display files with names like LETTER.DOC and 
  1364. LATTER.DAT, and LITTER.DU : 
  1365.  
  1366.         [c:\] dir l?tter.d??
  1367.  
  1368. The use of an asterisk wildcard before other characters, and of the character 
  1369. ranges discussed below, are enhancements to the standard wildcard syntax, and 
  1370. are not likely to work properly with software other than 4OS2. 
  1371.  
  1372. "Extra" question marks in your wildcard specification are ignored if the file 
  1373. name is shorter than the wildcard specification.  For example, if you have 
  1374. files called LETTER.DOC, LETTER1.DOC, and LETTERA.DOC, this command will 
  1375. display all three names: 
  1376.  
  1377.         [c:\] dir letter?.doc
  1378.  
  1379. The file LETTER.DOC is included in the display because the "extra" question 
  1380. mark at the end of "LETTER? " is ignored when matching the shorter name LETTER. 
  1381.  
  1382. In some cases, the question mark wildcard may be too general.  You can also 
  1383. specify what characters you want to accept (or exclude) in a particular 
  1384. position in the filename by using square brackets. Inside the brackets, you can 
  1385. put the individual acceptable characters or ranges of characters.  For example, 
  1386. if you wanted to match LETTER0.DOC through LETTER9.DOC, you could use this 
  1387. command: 
  1388.  
  1389.         [c:\] dir letter[0-9].doc
  1390.  
  1391. You could find all files that have a vowel as the second letter in their name 
  1392. this way.  This example also demonstrates how to mix the wildcard characters: 
  1393.  
  1394.         [c:\] dir ?[aeiouy]*.*
  1395.  
  1396. You can exclude a group of characters or a range of characters by using an 
  1397. exclamation mark [!] as the first character inside the brackets.  This example 
  1398. displays all filenames that are at least 2 characters long except those which 
  1399. have a vowel as the second letter in their names: 
  1400.  
  1401.         [c:\] dir ?[!aeiouy]*.*
  1402.  
  1403. The next example, which selects files such as AIP, BIP, and TIP but not NIP, 
  1404. demonstrates how you can use multiple ranges inside the brackets.  It will 
  1405. accept a file that begins with an A, B, C, D, T, U, or V: 
  1406.  
  1407.         [c:\] dir [a-dt-v]ip
  1408.  
  1409. You may use a question mark character inside the brackets, but its meaning is 
  1410. slightly different than a normal (unbracketed) question mark wildcard.  A 
  1411. normal question mark wildcard matches any character, but will be ignored when 
  1412. matching a name shorter than the wildcard specification, as described above.  A 
  1413. question mark inside brackets will match any character, but will not be 
  1414. discarded when matching shorter filenames.  For example: 
  1415.  
  1416.         [c:\] dir letter[?].doc
  1417.  
  1418. will display LETTER1.DOC and LETTERA.DOC, but not LETTER.DOC. 
  1419.  
  1420. A pair of brackets with no characters between them [], or an exclamation point 
  1421. and question mark together [!?], will match only if there is no character in 
  1422. that position.  For example, 
  1423.  
  1424.         [c:\] dir letter[].doc
  1425.  
  1426. will not display LETTER1.DOC or LETTERA.DOC, but will display LETTER.DOC.  This 
  1427. is most useful for commands like 
  1428.  
  1429.         [c:\] dir /I"[]" *.btm
  1430.  
  1431. which will display a list of all .BTM files which don't have a description. 
  1432.  
  1433. You can repeat any of the wildcard characters in any combination you desire 
  1434. within a single file name.  For example, the following command lists all files 
  1435. which have an A, B, or C as the third character, followed by zero or more 
  1436. additional characters, followed by a D, E, or F, followed optionally by some 
  1437. additional characters, and with an extension beginning with P or Q.  You 
  1438. probably won't need to do anything this complex, but we've included it to show 
  1439. you the flexibility of extended wildcards: 
  1440.  
  1441.         [c:\] dir ??[abc]*[def]*.[pq]*
  1442.  
  1443. You can also use the square bracket wildcard syntax to work around a conflict 
  1444. between HPFS filenames containing semicolons [;], and the use of a semicolon to 
  1445. indicate an include list. For example, if you have a file on an HPFS drive 
  1446. named C:\DATA\LETTER1;V2 and you enter this command: 
  1447.  
  1448.         [c:\] del \data\letter1;v2
  1449.  
  1450. you will not get the results you expect.  Instead of deleting the named file, 
  1451. 4OS2 will attempt to delete LETTER1 and then V2, because the semicolon 
  1452. indicates an include list.  However if you use square brackets around the 
  1453. semicolon it will be interpreted as a filename character, and not as an include 
  1454. list separator.  For example, this command would delete C:\DATA\LETTER1;V2 : 
  1455.  
  1456.         [c:\] del \data\letter1[;]v2
  1457.  
  1458.  
  1459. ΓòÉΓòÉΓòÉ 8.3. Date, Time, and Size Ranges ΓòÉΓòÉΓòÉ
  1460.  
  1461. Most internal commands which accept wild cards also allow date, time, and size 
  1462. ranges to further define the files that you wish to work with.  4OS2 will 
  1463. examine the files' timestamps (which record when the file was last modified), 
  1464. and the files' sizes, to determine which files meet the range criteria that you 
  1465. specify. 
  1466.  
  1467. A range begins with the switch character (/), followed by a left square bracket 
  1468. ("[") and a character that specifies the range type:  "s" for a size range, "d" 
  1469. for a date range, or "t" for a time range.  The "s", "d", or "t" is followed by 
  1470. a start value, and an optional comma and end value.  The range ends with a 
  1471. right square bracket ("]"). 
  1472.  
  1473. See the individual range types for details on specifying ranges: 
  1474.  
  1475.             Size Ranges 
  1476.             Date Ranges 
  1477.             Time Ranges 
  1478.  
  1479.  Using Ranges 
  1480.  
  1481.  If you combine two types of ranges, a file must satisfy both ranges to be 
  1482.  included.  For example, /[d2-8-95,2-9-95] /[s1024,2048] means files last 
  1483.  modified between February 8 and February 9, 1995, which are also between 1,024 
  1484.  and 2,048 bytes long. 
  1485.  
  1486.  When you use a date, time, or size range in a command, it should immediately 
  1487.  follow the command name.  Unlike some command switches which apply to only 
  1488.  part of the command line, the range usually applies to all file names 
  1489.  specified for the command.  Any exceptions are noted in the descriptions of 
  1490.  individual commands. 
  1491.  
  1492.  For example, to get a directory of all the *.C files dated October 1, 1994, 
  1493.  you could use this command: 
  1494.  
  1495.           [c:\] dir /[d10-1-94,+0] *.c
  1496.  
  1497.  To delete all of the 0-byte files on your hard disk, you could use this 
  1498.  command: 
  1499.  
  1500.           [c:\] del /[s0,0] *.* /s
  1501.  
  1502.  And to copy all of the non-zero byte files that you changed yesterday or today 
  1503.  to your floppy disk, you can use this command: 
  1504.  
  1505.           [c:\] copy /[d-1] /[s1] *.* a:
  1506.  
  1507.  The HPFS file system maintains 3 sets of dates and times for each file: 
  1508.  creation, last access, and last modification.  By default, date and time 
  1509.  ranges work with the last modification time stamp. You can use the "last 
  1510.  access" (a) or "created" (c) time stamp in a date or time range with the 
  1511.  syntax: 
  1512.  
  1513.           /[da...]  or  /[dc...]  or  /[ta...]  or  /[tc...]
  1514.  
  1515.  For example, to select files that were last accessed yesterday or today: 
  1516.  
  1517.           /[da-1]
  1518.  
  1519.  Date, time, and size ranges can be used with the ATTRIB, COPY, DEL, DESCRIBE, 
  1520.  DIR, EXCEPT, FFIND, FOR, LIST, MOVE, RD, REN, SELECT, and TYPE commands.  They 
  1521.  cannot be used with filename completion or in filename arguments for variable 
  1522.  functions. 
  1523.  
  1524.  
  1525. ΓòÉΓòÉΓòÉ 8.3.1. Size Ranges ΓòÉΓòÉΓòÉ
  1526.  
  1527. Size ranges simply select files whose size is between the limits given.  For 
  1528. example, /[s10000,20000] selects files between 10,000 and 20,000 bytes long. 
  1529.  
  1530. Either or both values in a size range can end with "k" to indicate thousands of 
  1531. bytes, "K" to indicate kilobytes (1,024 bytes), "m" to indicate millions of 
  1532. bytes, or "M" to indicate megabytes (1,048,576 bytes).  For example, the range 
  1533. above could be rewritten as /[s10k,20k]. 
  1534.  
  1535. All ranges are inclusive.  Both examples above will match files that are 
  1536. exactly 10,000 bytes and 20,000 bytes long, as well as all sizes in between. 
  1537.  
  1538. The second argument of a size range is optional.  If you use a single argument, 
  1539. like /[s10k], you will select files of that size or larger.  You can also 
  1540. precede the second argument with a plus sign [+]; when you do, it is added to 
  1541. the first value to determine the largest file size to include in the search. 
  1542. For example,  /[s10k,+1k] select files from 10,000 through 11,000 bytes in 
  1543. size. 
  1544.  
  1545. Some further examples of size ranges: 
  1546.  
  1547.         Specification       Selects Files
  1548.  
  1549.         /[s0,0]             of length zero (empty)
  1550.         /[s1M]              1 megabyte or more in length
  1551.         /[s10k,+200]        between 10,000 and 10,200 bytes
  1552.  
  1553.  
  1554. ΓòÉΓòÉΓòÉ 8.3.2. Date Ranges ΓòÉΓòÉΓòÉ
  1555.  
  1556. Date ranges select files that were created or last modified at any time between 
  1557. the two dates.  For example, /[d12-1-94,12-5-94] selects files that were last 
  1558. modified between December 1, 1994, and December 5, 1994. 
  1559.  
  1560. The time for the starting date defaults to 00:00:00 and the time for the ending 
  1561. date defaults to 23:59:59.  You can alter these defaults, if you wish, by 
  1562. including a start and stop time inside the date range.  The time is separated 
  1563. from the date with an at sign [@].  For example, the range 
  1564. /[d7-1-95@8:00a,7-3-95@6:00p] selects files that were modified at any time 
  1565. between 8:00 am on July 1, 1995 and 6:00 pm on July 3, 1995.  If you prefer, 
  1566. you can specify the times in 24-hour format (e.g., @18:00 for the end time in 
  1567. the previous example). 
  1568.  
  1569. If you omit the second argument in a date range, 4OS2 substitutes the current 
  1570. date and time.  For example, /[d10-1-94] selects files dated between October 1, 
  1571. 1994 and today. 
  1572.  
  1573. You can use an offset value for either the beginning or ending date, or both. 
  1574. An offset begins with a plus sign [+] or a minus sign [-] followed by an 
  1575. integer.  If you use an offset for the second value, it is calculated relative 
  1576. to the first.  If you use an offset for the first (or only) value, the current 
  1577. date is used as the basis for calculation.  For example: 
  1578.  
  1579.         Specification       Selects Files
  1580.  
  1581.         /[d10-27-94,+3]     modified between 10-27-94 and 10-30-94
  1582.         /[d10-27-94,-3]     modified between 10-24-94 and 10-27-94
  1583.         /[d-0]              modified today (from today minus zero days, to today)
  1584.         /[d-1]              modified yesterday or today (from today minus one day,
  1585.                             to today)
  1586.         /[d-1,+0]           modified yesterday (from today minus one day, to zero
  1587.                             days after that)
  1588.  
  1589. You cannot use offsets in the time portion of a date range (the part after an 
  1590. at sign), but you can combine a time with a date offset.  For example, 
  1591. /[d12-8-94@12:00,+2@12:00] selects files that were last modified between noon 
  1592. on December 8 and noon on December 10, 1994.  Similarly, /[d-2@15:00,+1] 
  1593. selects files last modified between 3:00 pm the day before yesterday and the 
  1594. end of the day one day after that, i.e., yesterday.  The second time defaults 
  1595. to the end of the day because no time is given. 
  1596.  
  1597. The HPFS file system maintains 3 sets of dates and times for each file: 
  1598. creation, last access, and last modification.  By default, date ranges work 
  1599. with the last modification date/time stamp.  You can use the "last access" (a) 
  1600. or "created" (c) date/time stamp in a date range with the syntax: 
  1601.  
  1602.         /[da...]  or  /[dc...]
  1603.  
  1604. For example, to select files that were last accessed yesterday or today: 
  1605.  
  1606.         /[da-1]
  1607.  
  1608.  
  1609. ΓòÉΓòÉΓòÉ 8.3.3. Time Ranges ΓòÉΓòÉΓòÉ
  1610.  
  1611. A time range specifies a file modification time without reference to the date. 
  1612. For example, to select files modified between noon and 2:00 pm on any date, use 
  1613. /[t12:00p,2:00p].  The times in a time range can either be in 12-hour format, 
  1614. with a trailing "a" for AM or "p" for PM, or in 24-hour format. 
  1615.  
  1616. If you omit the second argument in a time range, you will select files that 
  1617. were modified between the first time and the current time, on any date.  You 
  1618. can also use offsets, beginning with a plus sign [+] or a minus sign [-] for 
  1619. either or both of the arguments in a time range.  The offset values are 
  1620. interpreted as minutes.  Some examples: 
  1621.  
  1622.         Specification       Selects Files
  1623.  
  1624.         /[t12:00p,+120]     modified between noon and 2:00 PM on any date
  1625.         /[t-120,+120]       modified between two hours ago and the
  1626.                             current time on any date
  1627.         /[t0:00,11:59]      modified in the morning on any date
  1628. The HPFS file system maintains 3 sets of date and time for each file: creation, 
  1629. last access, and last modification.  By default, time ranges work with the last 
  1630. modification time stamp.  You can use the "last access" (a) or "created" (c) 
  1631. time stamp in a time range with the syntax: 
  1632.  
  1633.         /[ta...]  or  /[tc...]
  1634.  
  1635.  
  1636. ΓòÉΓòÉΓòÉ 8.4. Multiple Filenames ΓòÉΓòÉΓòÉ
  1637.  
  1638. Most file processing commands can work with multiple files at one time.  To use 
  1639. multiple file names, you simply list the files one after another on the command 
  1640. line, separated by spaces.  You can use wildcards in any or all of the 
  1641. filenames.  For example, to copy all .TXT and .DOC files from the current 
  1642. directory to drive A, you could use this command: 
  1643.  
  1644.         [c:\] copy *.txt *.doc a:
  1645.  
  1646. If the files you want to work with are not in the default directory, you must 
  1647. include the full path with each filename: 
  1648.  
  1649.         [c:\] copy a:\details\file1.txt a:\details\file1.doc c:
  1650.  
  1651. Multiple filenames are handy when you want to match a group of files which 
  1652. cannot be defined with a single filename and wildcards.  They let you be very 
  1653. specific about which files you want to work with in a command. 
  1654.  
  1655. When you use multiple filenames with a command that expects both a source and a 
  1656. destination, like COPY or MOVE, be sure that you always include a specific 
  1657. destination on the command line.  If you don't, the command will assume that 
  1658. the last filename is the destination and may overwrite important files. 
  1659.  
  1660. Like extended wildcards and include lists, the multiple filename feature will 
  1661. work with internal commands but not with external programs, unless those 
  1662. programs have been written to handle multiple file names on the command line. 
  1663.  
  1664. If you have a list of files to process that's too long to put on the command 
  1665. line or too time-consuming to type, see the SELECT command for another way of 
  1666. passing multiple file names to a command. 
  1667.  
  1668.  
  1669. ΓòÉΓòÉΓòÉ 8.5. Include Lists ΓòÉΓòÉΓòÉ
  1670.  
  1671. Any internal command that accepts multiple filenames will also accept one or 
  1672. more include lists.  An include list is simply a group of filenames, with or 
  1673. without wildcards, separated by semicolons [;].  All files in the include list 
  1674. must be in the same directory.  You may not add a space on either side of the 
  1675. semicolon. 
  1676.  
  1677. For example, you can shorten this command which uses multiple file names: 
  1678.  
  1679.         c:\> copy a:\details\file1.txt a:\details\file1.doc c:
  1680.  
  1681. to this using an include list: 
  1682.  
  1683.         c:\> copy a:\details\file1.txt;file1.doc c:
  1684.  
  1685. Multiple filenames and include lists are processed differently by the DIR and 
  1686. SELECT commands. If you use multiple filenames, all of the files matching the 
  1687. first filename are processed, then all of the files matching the second name, 
  1688. and so on.  When you use an include list, all files that match any entry in the 
  1689. include list are processed together, and will appear together in the directory 
  1690. display or SELECT list.  You can see this difference clearly if you experiment 
  1691. with both techniques and the DIR command.  For example, 
  1692.  
  1693.         [c:\] dir *.txt *.doc
  1694.  
  1695. will list all the .TXT files with a directory header, the file list, and a 
  1696. summary of the total number of files and bytes used.  Then it will do the same 
  1697. for the .DOC files.  However, 
  1698.  
  1699.         [c:\] dir *.txt;*.doc
  1700.  
  1701. will display all the files in one list. 
  1702.  
  1703. Like extended wildcards and multiple filenames, the include list feature will 
  1704. work with internal commands, but not with external programs (unless they have 
  1705. been programmed especially to support it). 
  1706.  
  1707.  
  1708. ΓòÉΓòÉΓòÉ 8.6. Executable Extensions ΓòÉΓòÉΓòÉ
  1709.  
  1710.  The syntax for creating an executable extension is: 
  1711.  
  1712.         set .ext=command [options]
  1713.  
  1714. This tells 4OS2 to run the specified command whenever you name a file with the 
  1715. extension .ext at the prompt. 
  1716.  
  1717. .EXT is the executable file extension; command is the name of the internal 
  1718. command, external program, alias, or batch file to run; and [options] are any 
  1719. command-line startup options you want to specify for the program, batch file, 
  1720. or alias. 
  1721.  
  1722. Normally, when you type a filename (as opposed to an alias or internal command 
  1723. name) as the first word on the command line, 4OS2 looks for a file with that 
  1724. name to execute.  The file's extension may be .EXE or .COM to indicate that it 
  1725. contains a program, it may have a batch file extension like .BTM, or the file's 
  1726. contents may indicate that it is executable. 
  1727.  
  1728. You can add to this default list of extensions, and have 4OS2 take the action 
  1729. you want with files that are not executable programs or batch files.  The 
  1730. action taken is always based on the file's extension.  For example, you could 
  1731. start your text editor whenever you type the name of a .DOC file, or start your 
  1732. database manager whenever you type the name of a .DAT file. 
  1733.  
  1734. Environment variables define the internal command, external program, batch 
  1735. file, or alias to run for each defined file extension.  To create an executable 
  1736. extension, use the SET command to create a new environment variable.  An 
  1737. environment variable is recognized as an executable extension if its name 
  1738. begins with a period. 
  1739.  
  1740. For example, if you want to run a word processor called EDITOR whenever you 
  1741. type the name of a file that has an extension of .EDT, you could use this 
  1742. command: 
  1743.  
  1744.         [c:\] set .edt=c:\edit\editor.exe
  1745.  
  1746. If the command specified in an executable extension is a batch file or external 
  1747. program, 4OS2 will search the PATH for it if necessary.  However, you can make 
  1748. sure that the correct program or batch file is used, and speed up the 
  1749. executable extension, by specifying the full name including drive, path, 
  1750. filename, and extension. 
  1751.  
  1752. Once an executable extension is defined, any time you name a file with that 
  1753. extension the corresponding program, batch file, or alias is started, with the 
  1754. name of your file passed to it as a parameter. 
  1755.  
  1756. The following example defines QBASIC.EXE as the processor for .BAS files: 
  1757.  
  1758.         [c:\] set .bas=c:\dos\qbasic.exe /run
  1759.  
  1760. With this definition, if you have a file named PUSHCART.BAS in the current 
  1761. directory and enter the command: 
  1762.  
  1763.         [c:\] pushcart
  1764.  
  1765. 4OS2 will execute the command: 
  1766.  
  1767.         c:\dos\qbasic.exe /run pushcart.bas
  1768.  
  1769. The next example defines B.EXE (the Brief text editor) as the processor for .C 
  1770. files: 
  1771.  
  1772.         [c:\] set .c=c:\brief\b.exe -Mxyz
  1773.  
  1774. Now, if you have a file called HELLO.C and enter the command 
  1775.  
  1776.         [c:\] hello -i30
  1777.  
  1778. This will be expanded to: 
  1779.  
  1780.         c:\brief\b.exe -Mxyz hello.c -i30
  1781.  
  1782. Notice that the text from the .C environment variable is inserted at the 
  1783. beginning of the line, including any options, followed by the original file 
  1784. name plus its extension, and then the remainder of the original command line. 
  1785.  
  1786. In order for executable extensions to work, the command, program, batch file, 
  1787. or alias must be able to interpret the command line properly.  For example, if 
  1788. a program you want to run doesn't accept a file name on its command line as 
  1789. shown in these examples, then executable extensions won't work with that 
  1790. program. 
  1791.  
  1792. Executable extensions may include wildcards, so you could, for example, run 
  1793. your text editor for any file with an extension beginning with T by defining an 
  1794. executable extension called .T*.  Extended wildcards (e.g., DO[CT] for .DOC and 
  1795. .DOT files) may also be used. 
  1796.  
  1797.  
  1798. ΓòÉΓòÉΓòÉ 9. Batch Files ΓòÉΓòÉΓòÉ
  1799.  
  1800. A batch file is a file that contains a list of commands to execute.  4OS2 reads 
  1801. and interprets each line as if it had been typed at the keyboard.  Like 
  1802. aliases, batch files are handy for automating computing tasks.  Unlike aliases, 
  1803. batch files can be as long as you wish.  Batch files take up separate disk 
  1804. space for each file, and can't usually execute quite as quickly as aliases, 
  1805. since they must be read from the disk. 
  1806.  
  1807. The topics included in this section are: 
  1808.  
  1809.             .BAT, .CMD, and .BTM Files 
  1810.             Echoing in Batch Files 
  1811.             Batch File Line Continuation 
  1812.             Batch File Parameters 
  1813.             Automatic Batch Files 
  1814.             Detecting 4OS2 
  1815.             Batch File Compression 
  1816.             Argument Quoting 
  1817.             4DOS, 4OS2, and 4DOS/NT Compatibility 
  1818.             REXX Support 
  1819.             EXTPROC Support 
  1820.  
  1821.  
  1822. ΓòÉΓòÉΓòÉ 9.1. .BAT, .CMD, and .BTM Files ΓòÉΓòÉΓòÉ
  1823.  
  1824. A batch file can run in two different modes.  In the first, traditional mode, 
  1825. each line of the batch file is read and executed individually.  In the second 
  1826. mode, the entire batch file is read into memory at once.  The second mode can 
  1827. be 5 to 10 times faster, especially if most of the commands in the batch file 
  1828. are internal commands.  However, only the first mode can be used for 
  1829. self-modifying batch files (which are rare), and for batch files larger than 
  1830. 64K bytes. 
  1831.  
  1832. The batch file's extension determines its mode.  Files with a .CMD extension 
  1833. are run in the slower, traditional mode.  Files with a .BTM extension are run 
  1834. in the faster, more efficient mode.  You can change the execution mode inside a 
  1835. batch file with the LOADBTM command. 
  1836.  
  1837.  
  1838. ΓòÉΓòÉΓòÉ 9.2. Echoing in Batch Files ΓòÉΓòÉΓòÉ
  1839.  
  1840. By default, each line in a batch file is displayed or "echoed" as it is 
  1841. executed.  You can change this behavior, if you want, in several different 
  1842. ways: 
  1843.  
  1844.         Any batch file line that begins with an [@] symbol will not be 
  1845.         displayed. 
  1846.  
  1847.         The display can be turned off and on within a batch file with the ECHO 
  1848.         OFF and ECHO ON commands. 
  1849.  
  1850.         The default setting can be changed with the SETDOS /V command or the 
  1851.         BatchEcho directive in the .INI file. 
  1852.  
  1853.  For example, the following line turns off echoing inside a batch file.  The 
  1854.  [@] symbol keeps the batch file from displaying the ECHO OFF command: 
  1855.  
  1856.           @echo off
  1857.  
  1858.  4OS2 also has a command line echo that is unrelated to the batch file echo 
  1859.  setting.  See ECHO for details about both settings. 
  1860.  
  1861.  
  1862. ΓòÉΓòÉΓòÉ 9.3. Batch File Line Continuation ΓòÉΓòÉΓòÉ
  1863.  
  1864. 4OS2 will combine multiple lines in the batch file into a single line for 
  1865. processing when you include the escape character as the very last character of 
  1866. each line to be combined (except the last). The default escape character is the 
  1867. caret [^].  For example: 
  1868.  
  1869.         echo The quick brown fox jumped over the lazy^
  1870.         sleeping^
  1871.         dog. > alphabet
  1872.  
  1873. You cannot use this technique to extend a batch file line beyond the normal 
  1874. line length limit of 1,023 characters. 
  1875.  
  1876.  
  1877. ΓòÉΓòÉΓòÉ 9.4. Batch File Parameters ΓòÉΓòÉΓòÉ
  1878.  
  1879. Like aliases and application programs, batch files can examine the command line 
  1880. that is used to invoke them.  The command tail (everything on the command line 
  1881. after the batch file name) is separated into individual parameters (also called 
  1882. arguments or batch variables) by scanning for the spaces, tabs, and commas that 
  1883. separate the parameters.  A batch file can work with the individual parameters 
  1884. or with the command tail as a whole. 
  1885.  
  1886. These parameters are numbered from %1 to %127.  %1 refers to the first 
  1887. parameter on the command line, %2 to the second, and so on.  It is up to the 
  1888. batch file to determine the meaning of each parameter.  You can use quotation 
  1889. marks to pass spaces, tabs, commas, and other special characters in a batch 
  1890. file parameter; see Argument Quoting for details. 
  1891.  
  1892. Parameters that are referred to in a batch file, but which are missing on the 
  1893. command line, appear as empty strings inside the batch file.  For example, if 
  1894. you start a batch file and put two parameters on the command line, any 
  1895. reference in the batch file to %3, or any higher-numbered parameter, will be 
  1896. interpreted as an empty string. 
  1897.  
  1898. A batch file can also work with three special parameters:  %0 contains the name 
  1899. of the batch file as it was entered on the command line, %# contains the number 
  1900. of command line arguments, and %n$ contains the complete command-line tail 
  1901. starting with argument number "n" (for example, %3$ means the third parameter 
  1902. and all those after it).  The default value of "n" is 1, so %$ contains the 
  1903. entire command tail.  The values of these special parameters will change if you 
  1904. use the SHIFT command. 
  1905.  
  1906. By default, 4DOS uses an ampersand [&] instead of a dollar sign [$] to indicate 
  1907. the remainder of the command tail.  For example, %& means all the parameters, 
  1908. and %2& means the second parameter and all those after it.  If you want to 
  1909. share batch files or aliases between 4DOS and 4OS2, you can select a new 
  1910. character for any product with the SETDOS /P command or the ParameterChar 
  1911. directive in your .INI file. 
  1912.  
  1913. For example, if your batch file interprets the first argument as a subdirectory 
  1914. name then the following line would move to the specified directory: 
  1915.  
  1916.         cd %1
  1917.  
  1918. Batch files can also use environment variables, internal variables, and 
  1919. variable functions. 
  1920.  
  1921.  
  1922. ΓòÉΓòÉΓòÉ 9.5. Automatic Batch Files ΓòÉΓòÉΓòÉ
  1923.  
  1924. Each time 4OS2 starts as either a primary or a secondary shell, it looks for an 
  1925. automatic batch file called 4START.BTM or 4START.CMD.  If the 4START batch file 
  1926. is not in the same directory as 4OS2 itself, you should use the 4StartPath 
  1927. directive in your .INI file to specify its location.  4START is optional, so 
  1928. 4OS2 will not display an error message if it cannot find the file. 
  1929.  
  1930. Whenever a 4OS2 shell ends, it runs a third automatic batch file called 
  1931. 4EXIT.BTM, 4EXIT.CMD.  This file, if you use it, should be in the same 
  1932. directory as your 4START batch file.  Like 4START, 4EXIT is optional.  It is 
  1933. not necessary in most circumstances, but it is a convenient place to put 
  1934. commands to save information such as a history list before a shell ends, or LOG 
  1935. the end of the shell. 
  1936.  
  1937.  
  1938. ΓòÉΓòÉΓòÉ 9.6. Detecting 4OS2 ΓòÉΓòÉΓòÉ
  1939.  
  1940. From a batch file, you can determine if 4OS2 is loaded by testing for the 
  1941. variable function @EVAL, with a test like this: 
  1942.  
  1943.         if "%@eval[2+2]" == "4" echo 4OS2 is loaded!
  1944.  
  1945. This test can never succeed in CMD.EXE. Other variable functions could be used 
  1946. for the same purpose. 
  1947.  
  1948.  
  1949. ΓòÉΓòÉΓòÉ 9.7. Batch File Compression ΓòÉΓòÉΓòÉ
  1950.  
  1951. You can compress your .BTM files with a program called BATCOMP.EXE, which is 
  1952. distributed with 4OS2.  This program condenses batch files by about a third and 
  1953. makes them unreadable with the LIST command and similar utilities.  Compressed 
  1954. batch files run at approximately the same speed as regular .BTM files. 
  1955.  
  1956. You may want to consider compressing batch files if you need to distribute them 
  1957. to others and keep your original code secret or prevent your users from 
  1958. altering them.  You may also want to consider compressing batch files to save 
  1959. some disk space on the systems where the compressed files are used. 
  1960.  
  1961. The full syntax for the batch compression program is 
  1962.  
  1963.         BATCOMP [/O] input file [output file ]
  1964.  
  1965. You must specify the full name of the input file, including its extension, on 
  1966. the BATCOMP command line.  If you do not specify the output file, BATCOMP will 
  1967. use the same base name as the input file and add a .BTM extension.  BATCOMP 
  1968. will also add a .BTM extension if you specify a base name for the output file 
  1969. without an extension.  For example, to compress MYBATCH.CMD and save the result 
  1970. as MYBATCH.BTM, you can use any of these three commands: 
  1971.  
  1972.         [c:\] batcomp mybatch.cmd
  1973.         [c:\] batcomp mybatch.cmd mybatch
  1974.         [c:\] batcomp mybatch.cmd mybatch.btm
  1975.  
  1976. If the output file (MYBATCH.BTM in the examples above) already exists, BATCOMP 
  1977. will prompt you before overwriting the file.  You can disable the prompt by 
  1978. including /O on the BATCOMP command line immediately before the input file 
  1979. name.  Even if you use the /O option, BATCOMP will not compress a file into 
  1980. itself. 
  1981.  
  1982. JP Software does not provide a decompression utility to decompress batch files. 
  1983. If you use BATCOMP.EXE, make sure that you also keep a copy of the original 
  1984. batch file for future inspection or modification. 
  1985.  
  1986. Each of our command processors includes its own version of BATCOMP.EXE, set up 
  1987. to run under the corresponding operating system. However, the output produced 
  1988. by each program is the same, so a batch file compressed with any version of 
  1989. BATCOMP can be used with any JP Software command processor. 
  1990.  
  1991. If you plan to distribute batch files to users of different platforms, see 
  1992. 4DOS, 4OS2, and 4DOS/NT Compatibility. 
  1993.  
  1994.  
  1995. ΓòÉΓòÉΓòÉ 9.8. Argument Quoting ΓòÉΓòÉΓòÉ
  1996.  
  1997. As it parses the command line, 4OS2 looks for the ampersand [&] command 
  1998. separator, conditional commands (|| or &&), white space (spaces, tabs, and 
  1999. commas), percent signs [%] which indicate variables to be expanded, and 
  2000. redirection and piping characters (>, <, or |). 
  2001.  
  2002. Normally, these special characters cannot be passed to a command as part of an 
  2003. argument.  However, you can include any of the special characters in an 
  2004. argument by enclosing the entire argument in single back quotes [`] or double 
  2005. quotes ["].  Although both back quotes and double quotes will let you build 
  2006. arguments that include special characters, they do not work the same way. 
  2007.  
  2008. No alias or variable expansion is performed on an argument enclosed in back 
  2009. quotes.  Redirection symbols inside the back quotes are ignored.  The back 
  2010. quotes are removed from the command line before the command is executed. 
  2011.  
  2012. No alias expansion is performed on expressions enclosed in double quotes. 
  2013. Redirection symbols inside double quotes are ignored. However, variable 
  2014. expansion is performed on expressions inside double quotes.  The double quotes 
  2015. themselves will be passed to the command as part of the argument. 
  2016.  
  2017. For example, suppose you have a batch file CHKNAME.BTM which expects a name as 
  2018. its first parameter (%1).  Normally the name is a single word.  If you need to 
  2019. pass a two-word name with a space in it to this batch file you could use the 
  2020. command: 
  2021.  
  2022.         [c:\] chkname `MY NAME`
  2023.  
  2024. Inside the batch file, %1 will have the value MY NAME, including the space. 
  2025. The back quotes caused 4OS2 to pass the string to the batch file as a single 
  2026. argument.  The quotes keep characters together and reduce the number of 
  2027. arguments in the line. 
  2028.  
  2029. When an alias is defined in a batch file or from the command line, its argument 
  2030. can be enclosed in back quotes to prevent the expansion of replaceable 
  2031. parameters, variables, and multiple commands until the alias is invoked.  See 
  2032. ALIAS for details. 
  2033.  
  2034. You can disable and re-enable back quotes and double quotes with the SETDOS /X 
  2035. command. 
  2036.  
  2037.  
  2038. ΓòÉΓòÉΓòÉ 9.9. 4DOS, 4OS2, and 4DOS/NT Compatibility ΓòÉΓòÉΓòÉ
  2039.  
  2040. If you use two or more of our products, or if you want to share aliases and 
  2041. batch files with users of different products, you need to be aware of the 
  2042. differences in three important characters:  the Command Separator (see Multiple 
  2043. Commands), the Escape Character (see Escape Character), and the Parameter 
  2044. Character (see Batch File Parameters). 
  2045.  
  2046. The default values of each of these characters in each product is shown in the 
  2047. following chart (in this section, <Ctrl-X> stands for the ASCII Ctrl-X 
  2048. character, numeric value 24.  This character appears on your screen as an 
  2049. up-arrow [].): 
  2050.  
  2051.         Character           4DOS Default   4OS2 and 4NT Default
  2052.  
  2053.         Command Separator        ^              &
  2054.         Escape Character         <Ctrl-X>       ^
  2055.         Parameter Character      &              $
  2056.  
  2057. [JP Software's graphical command processors (Take Command/16 for Windows 3.x, 
  2058. Take Command/32 for Windows NT and Windows 95, and Take Command for OS/2) use 
  2059. the same default characters.  Take Command/16 uses the 4DOS characters, and 
  2060. Take Command/32 and Take Command for OS/2 use the 4OS2 and 4DOS/NT characters.] 
  2061.  
  2062. In your batch files and aliases, and even at the command line, you can smooth 
  2063. over these differences in two ways: 
  2064.  
  2065.         *   Select a consistent set of characters with .INI file configuration 
  2066.             directives or the SETDOS command.  For example, to set the 4OS2 
  2067.             characters to match 4DOS, use: 
  2068.  
  2069.                                 CommandSep = ^
  2070.                                 EscapeChar = <Ctrl-X>
  2071.                                 ParameterChar = &
  2072.  
  2073.             in 4OS2.INI. 
  2074.  
  2075.         *   Use internal variables that contain the current special character, 
  2076.             rather than using the character itself (see + and =).  For example, 
  2077.             this command: 
  2078.  
  2079.                                 if "%1" == "" (echo Argument missing! ^ quit)
  2080.  
  2081.             will only work if the command separator is a caret. However, this 
  2082.             version works regardless of the current command separator: 
  2083.  
  2084.                                 if "%1" == "" (echo Argument missing! %+ quit)
  2085.  
  2086.  
  2087.  The following chart shows the correspondence between the appropriate SETDOS 
  2088.  command options, .INI file directives, and internal variables: 
  2089.  
  2090.           Special                 SETDOS   INI File     Internal
  2091.           Character               Switch   Directive    Variable
  2092.  
  2093.           Command Separator        /C      CommandSep     %+
  2094.           Escape Character         /E      EscapeChar     %=
  2095.           Parameter Character      /P      ParameterChar  (none)
  2096.  
  2097.  
  2098. ΓòÉΓòÉΓòÉ 9.10. REXX Support ΓòÉΓòÉΓòÉ
  2099.  
  2100. REXX is a a powerful file and text processing language developed by IBM, and 
  2101. available on many PC and other platforms.  REXX is an ideal extension to the 
  2102. 4OS2 batch language, especially if you need advanced string processing 
  2103. capabilities. 
  2104.  
  2105. The REXX language is not built into 4OS2.  Under IBM OS/2 1.3 and above you can 
  2106. use the built-in REXX language provided by IBM, or use Personal REXX for OS/2, 
  2107. developed by Quercus Systems of Saratoga, CA.  (Personal REXX is available from 
  2108. JP Software or directly from Quercus Systems.) 
  2109.  
  2110. REXX programs are stored in .CMD files.  4OS2 checks to see if the first two 
  2111. characters on the first line of a .CMD file are [/*], the beginning of a REXX 
  2112. comment.  If so, it passes the file to OS/2's built-in REXX facility for 
  2113. processing.  If Personal REXX for OS/2 is installed, it automatically replaces 
  2114. OS/2's built-in REXX, and handles all REXX commands passed by 4OS2. 
  2115.  
  2116. Both Personal REXX and OS/2's built-in REXX extend the interface between REXX 
  2117. and 4OS2 by allowing you to invoke 4OS2 commands from within a REXX program. 
  2118. For details, or for more information on any aspect of REXX, see your Personal 
  2119. REXX or OS/2 REXX documentation. 
  2120.  
  2121. You can run additional batch files from within your REXX program. .CMD files 
  2122. can be run by placing the name of the file on a line by itself in single 
  2123. quotes, for example: 
  2124.  
  2125.         `mybatch.cmd`
  2126.  
  2127. .BTM files cannot be run with this method, because the REXX processor does not 
  2128. recognize the .BTM extension (this is not a limitation of 4OS2).  To start a 
  2129. .BTM file from a REXX file, use the CALL command, for example: 
  2130.  
  2131.         `call mybatch.btm`
  2132.  
  2133.  
  2134. ΓòÉΓòÉΓòÉ 9.11. EXTPROC Support ΓòÉΓòÉΓòÉ
  2135.  
  2136. 4OS2 offers an external processor (EXTPROC) option for batch files that lets 
  2137. you define an external program to process a particular .CMD file.  To identify 
  2138. a .CMD file to be used with an external processor, place the string "EXTPROC" 
  2139. as the first word on the first line of the file, followed by the name of the 
  2140. external program that should be called.  4OS2 will start the program and pass 
  2141. it the name of the .CMD file and any command-line arguments that were entered. 
  2142.  
  2143. For example, suppose GETDATA.CMD contains the following lines: 
  2144.  
  2145.         EXTPROC D:\DATAACQ\DATALOAD.EXE
  2146.         OPEN PORT1
  2147.         READ 4000
  2148.         DISKWRITE D:\DATAACQ\PORT1\RAW
  2149.  
  2150. Then if you entered the command: 
  2151.  
  2152.         [d:\dataacq] getdata /p17
  2153.  
  2154. 4OS2 would read the GETDATA.CMD file, determine that it began with an EXTPROC 
  2155. command, read the name of the processor program, and then execute the command: 
  2156.  
  2157.         D:\DATAACQ\DATALOAD.EXE D:\DATAACQ\GETDATA.CMD /p17
  2158.  
  2159. The hypothetical DATALOAD.EXE program would then be responsible for reopening 
  2160. the GETDATA.CMD file, ignoring the EXTPROC line at the start, and interpreting 
  2161. the other instructions in the file. It would also have to respond appropriately 
  2162. to the command-line parameter entered (/p17). 
  2163.  
  2164. Do not try to use 4OS2 as the external processor named on the EXTPROC line in 
  2165. the .CMD file.  It will interpret the EXTPROC line as a command to re-open 
  2166. themselves.  The result will be an infinite loop that will continue until the 
  2167. computer runs out of resources and locks up. 
  2168.  
  2169.  
  2170. ΓòÉΓòÉΓòÉ 10. The Environment ΓòÉΓòÉΓòÉ
  2171.  
  2172. The environment is a collection of information about your computer that every 
  2173. program receives.  Each entry in the environment consists of a variable name, 
  2174. followed by an equal sign and a string of text.  You can automatically 
  2175. substitute the text for the variable name in any command.  To create the 
  2176. substitution, include a percent sign [%] and a variable name on the command 
  2177. line or in an alias or batch file. 
  2178.  
  2179. The following environment variables have special meanings in 4OS2: 
  2180.  
  2181.             CDPATH 
  2182.             CMDLINE 
  2183.             COLORDIR 
  2184.             COMSPEC 
  2185.             PATH 
  2186.             PROMPT 
  2187.  
  2188.  4OS2 also supports two special types of variables.  Internal variables are 
  2189.  similar to environment variables, but are stored internally within 4OS2, and 
  2190.  are not visible in the environment.  They provide information about your 
  2191.  system for use in batch files and aliases.  Variable functions are referenced 
  2192.  like environment variables, but perform additional functions like file 
  2193.  handling, string manipulation and arithmetic calculations. 
  2194.  
  2195.  The SET command is used to create environment variables. For example, you can 
  2196.  create a variable named BACKUP like this: 
  2197.  
  2198.           [c:\] set BACKUP=*.bak;*.bk!;*.bk
  2199.  
  2200.  If you then type 
  2201.  
  2202.           [c:\] del %BACKUP
  2203.  
  2204.  it is equivalent to the following command: 
  2205.  
  2206.           del *.bak;*.bk!;*.bk
  2207.  
  2208.  The variable names you use this way may contain any alphabetic or numeric 
  2209.  characters, the underscore character [_], and the dollar sign [$].  You can 
  2210.  force acceptance of other characters by including the full variable name in 
  2211.  square brackets, like this: %[AB##2].  You can also "nest" environment 
  2212.  variables using square brackets.  For example %[%var1] means "the contents of 
  2213.  the variable whose name is stored in VAR1".  A variable referenced with this 
  2214.  technique cannot contain more than 255 characters of information.  Nested 
  2215.  variable expansion can be disabled with the SETDOS /X command. 
  2216.  
  2217.  In 4OS2 the size of the environment is set automatically, and increased as 
  2218.  needed when you add variables. 
  2219.  
  2220.  The trailing percent sign that was traditionally required for environment 
  2221.  variable names is not usually required in 4OS2, which accept any character 
  2222.  that cannot be part of a variable name as the terminator.  However, the 
  2223.  trailing percent can be used to maintain compatibility. 
  2224.  
  2225.  The trailing percent sign is needed if you want to join two variable values. 
  2226.  The following examples show the possible interactions between variables and 
  2227.  literal strings.  First, create two environment variables called ONE and TWO 
  2228.  this way: 
  2229.  
  2230.           [c:\] set ONE=abcd
  2231.           [c:\] set TWO=efgh
  2232.  
  2233.  Now the following combinations produce the output text shown: 
  2234.  
  2235.           %ONE%TWO            abcdTWO   ("%ONE%" + "TWO")
  2236.           %ONE%TWO%           abcdTWO   ("%ONE%" + "TWO%")
  2237.           %ONE%%TWO           abcdefgh  ("%ONE%" + "%TWO")
  2238.           %ONE%%TWO%          abcdefgh  ("%ONE%" + "%TWO%")
  2239.           %ONE%[TWO]          abcd[TWO] ("%ONE%" + "[TWO]")
  2240.           %ONE%[TWO]%         abcd[TWO] ("%ONE%" + "[TWO]%")
  2241.           %[ONE]%TWO          abcdefgh  ("%[ONE]" + "%TWO")
  2242.           %[ONE]%TWO%         abcdefgh  ("%[ONE]" + "%TWO%")
  2243.  
  2244.  If you want to pass a percent sign to a command, or a string which includes a 
  2245.  percent sign, you must use two percent signs in a row. Otherwise, the single 
  2246.  percent sign will be seen as the beginning of a variable name and will not be 
  2247.  passed on to the command.  For example, to display the string "We're with you 
  2248.  100%" you would use the command: 
  2249.  
  2250.           echo We're with you 100%%
  2251.  
  2252.  You can also use back quotes around the text, rather than a double percent 
  2253.  sign.  See Argument Quoting for details. 
  2254.  
  2255.  
  2256. ΓòÉΓòÉΓòÉ 10.1. CDPATH ΓòÉΓòÉΓòÉ
  2257.  
  2258. CDPATH tells 4OS2 where to search for directories specified by the CD, CDD, and 
  2259. PUSHD commands and in automatic directory changes.  (_CDPATH can be used as an 
  2260. alternative to CDPATH if you are using Microsoft Bookshelf, which uses a CDPATH 
  2261. variable for its own purposes.) 
  2262.  
  2263. CDPATH is composed of a list of directories, separated by semicolons [;].  If 
  2264. CD, CDD, PUSHD, or an automatic directory change can't locate the specified 
  2265. directory to change to, they will append the specified directory name to each 
  2266. directory in CDPATH and attempt to change to that drive and directory, until 
  2267. the first match or the end of the CDPATH argument.  This allows you to use 
  2268. CDPATH as a quick way to find commonly used subdirectories which have unique 
  2269. names.  For example, if you are currently in the directory 
  2270. C:\WP\LETTERS\JANUARY and you'd like to change to D:\SOFTWARE\UTIL, you could 
  2271. enter the command: 
  2272.  
  2273.         [c:\wp\letters\january] cdd d:\software\util
  2274.  
  2275. However, if the D:\SOFTWARE directory is listed in your CDPATH variable, and is 
  2276. the first directory in the list with a UTIL subdirectory, you can simply enter 
  2277. the command 
  2278.  
  2279.         [c:\wp\letters\january] cdd util
  2280.  
  2281. to change to D:\SOFTWARE\UTIL. 
  2282.  
  2283. You can create CDPATH with the SET command.  For example, if you want the 
  2284. directory change commands to search the C:\DATA directory, the D:\SOFTWARE 
  2285. directory, and the root directory of drive E:\ for the subdirectories that you 
  2286. name, you should create CDPATH with this command: 
  2287.  
  2288.         [c:\] set cdpath=c:\data;d:\software;e:\
  2289.  
  2290.  
  2291. ΓòÉΓòÉΓòÉ 10.2. CMDLINE ΓòÉΓòÉΓòÉ
  2292.  
  2293. CMDLINE is the fully expanded text of the currently executing command line. 
  2294. CMDLINE is set just before invoking any .COM, .EXE, .BTM, .BAT, or .CMD file. 
  2295. If a command line is prefaced with an "@" to prevent echoing, it will not be 
  2296. put in CMDLINE, and any previous CMDLINE variable will be removed from the 
  2297. environment. 
  2298.  
  2299.  
  2300. ΓòÉΓòÉΓòÉ 10.3. ┬áCOLORDIR ΓòÉΓòÉΓòÉ
  2301.  
  2302. COLORDIR controls directory display colors used by DIR and SELECT.  See 
  2303. Color-Coded Directories for a complete description of the format of this 
  2304. variable. 
  2305.  
  2306.  
  2307. ΓòÉΓòÉΓòÉ 10.4. COMSPEC ΓòÉΓòÉΓòÉ
  2308.  
  2309. COMSPEC contains the full path and name of 4OS2.  For example, if 4OS2 is 
  2310. stored in the directory C:\4OS2, the COMSPEC variable should be set to 
  2311. C:\4OS2\4OS2.EXE.  COMSPEC is used by applications which need to find 4OS2 to 
  2312. implement a "shell to the command prompt" feature. 
  2313.  
  2314. You can set the COMSPEC variable by specifying the COMSPEC path with a SET 
  2315. COMSPEC command in CONFIG.SYS, or including the COMSPEC path on the 4OS2 
  2316. startup command line. 
  2317.  
  2318.  
  2319. ΓòÉΓòÉΓòÉ 10.5. ┬áPATH ΓòÉΓòÉΓòÉ
  2320.  
  2321. PATH is a list of directories that 4OS2 will search for executable files that 
  2322. aren't in the current directory.  PATH may also be used by some application 
  2323. programs to find their own files. See the PATH command for a full description 
  2324. of this variable. 
  2325.  
  2326.  
  2327. ΓòÉΓòÉΓòÉ 10.6. ┬áPROMPT ΓòÉΓòÉΓòÉ
  2328.  
  2329. PROMPT defines the command-line prompt.  It can be set or changed with the 
  2330. PROMPT command. 
  2331.  
  2332.  
  2333. ΓòÉΓòÉΓòÉ 11. Internal Variables ΓòÉΓòÉΓòÉ
  2334.  
  2335. Internal variables are special variables built into 4OS2 to provide information 
  2336. about your system.  They are not actually stored in the environment, but can be 
  2337. used in commands, aliases, and batch files just like any environment variable. 
  2338. The values of these variables are stored internally in 4OS2, and cannot be 
  2339. changed with the SET, UNSET, or ESET command.  However, you can override any of 
  2340. these variables by defining a new variable with the same name. 
  2341.  
  2342. The list below gives a one-line description of each variable, and a 
  2343. cross-reference which selects a full screen help topic on that variable. Most 
  2344. of the variables are simple enough that the one-line description is sufficient. 
  2345. However, for those variables marked with an asterisk [*], the cross-reference 
  2346. topic contains some additional information you may wish to review.  You can 
  2347. also obtain help on any variable with a HELP variablename command at the prompt 
  2348. (this is why each variable has its own topic, in addition to its appearance in 
  2349. the list below). 
  2350.  
  2351. See the discussion after the variable list for some additional information, and 
  2352. examples of how these variables can be used. 
  2353.  
  2354. The variables are: 
  2355.  
  2356. Hardware status 
  2357.  
  2358.         _CPU            CPU type (86, 186, 200, 386, 486, 586) 
  2359.         _MONITOR        Monitor type (mono or color) 
  2360.         _NDP            Coprocessor type (0, 87, 287, 387) 
  2361.         _VIDEO          Video board type (mono, cga, ega, vga, xga, 8514, or 
  2362.                         IA/A) 
  2363.  
  2364.  Operating system and software status 
  2365.  
  2366.         _ANSI           ANSI status (always 1 in 4OS2) 
  2367.         _BOOT           Boot drive letter, without a colon 
  2368.         _CI             Current cursor shape in insert mode 
  2369.         _CO             Current cursor shape in overstrike mode 
  2370.         _CODEPAGE       Current code page number 
  2371.         _COUNTRY        Current country code 
  2372.         _DOS            * Operating system (DOS, OS2, etc.) 
  2373.         _DOSVER         * Operating system version (2.1, 3.0, etc.) 
  2374.         _KBHIT          Keystroke waiting in buffer (0 or 1) 
  2375.         _MOUSE          Mouse driver flag (always 1 in 4OS2) 
  2376.  
  2377.  Command processor status 
  2378.  
  2379.         _4VER           4OS2 version (2.5, 2.51, etc.) 
  2380.         _BATCH          Batch nesting level 
  2381.         _BATCHLINE      Current line number in current batch file 
  2382.         _BATCHNAME      Name of current batch file 
  2383.         _DNAME          Name of file used to store file descriptions 
  2384.         _HLOGFILE       Current history log file name 
  2385.         _LOGFILE        Current log file name 
  2386.         _PID            4OS2 process ID (numeric) 
  2387.         _PIPE           Whether running in a pipe 
  2388.         _PPID           Parent process ID (numeric) 
  2389.         _PTYPE          OS/2 session type (AVIO, DT, FS, PM) 
  2390.         _SHELL          Shell level (0, 1, 2, ...) 
  2391.         _SID            Current OS/2 session ID 
  2392.         _TRANSIENT      * Transient shell flag (0 or 1) 
  2393.         _WINTITLE       Current window title 
  2394.  
  2395.  Screen and color 
  2396.  
  2397.         _BG             Background color at cursor position 
  2398.         _COLUMN         Current cursor column 
  2399.         _COLUMNS        Screen width 
  2400.         _FG             Foreground color at cursor position 
  2401.         _ ROW           Current cursor row 
  2402.         _ROWS           Screen height 
  2403.  
  2404.  Drives and directories 
  2405.  
  2406.         _CWD            Current drive and directory (d:\path) 
  2407.         _CWDS           Current drive and directory with trailing \ (d:\path\) 
  2408.         _CWP            Current directory (\path) 
  2409.         _CWPS           Current directory with trailing \ (\path\) 
  2410.         _DISK           Current drive (C, D, etc.) 
  2411.         _LASTDISK       Last possible drive (E, F, etc.) 
  2412.  
  2413.  Dates and times 
  2414.  
  2415.         _DATE           * Current date (mm-dd-yy) 
  2416.         _DAY            Day of the month (1 - 31) 
  2417.         _DOW            Day of the week (Mon, Tue, Wed, etc.) 
  2418.         _DOY            Day of the year (1 - 366) 
  2419.         _HOUR           Hour (0 - 23) 
  2420.         _MINUTE         Minute (0 - 59) 
  2421.         _MONTH          Month of the year (1 - 12) 
  2422.         _SECOND         Second (0 - 59) 
  2423.         _TIME           * Current time (hh:mm:ss) 
  2424.         _YEAR           Year (1980 - 2099) 
  2425.  
  2426.  Error codes 
  2427.  
  2428.         ?               * Exit code, last external program 
  2429.         _?              * Exit code, last internal command 
  2430.         _SYSERR         * Last OS/2 error code 
  2431.  
  2432.  Compatibility 
  2433.  
  2434.         =               * Substitutes escape character 
  2435.         +               * Substitutes command separator 
  2436.  
  2437.  Examples 
  2438.  
  2439.  You can use these variables in a wide variety of ways depending on your needs. 
  2440.  Here are just a few examples.  Some of these examples rely on the IF and IFF 
  2441.  commands to test the value of a variable and perform different actions based 
  2442.  on that value. 
  2443.  
  2444.  In a batch file, set the color based on the video card type: 
  2445.  
  2446.           iff "%_video"=="mono" then
  2447.             color bright white on black
  2448.           else
  2449.             color bright white on blue
  2450.           endiff
  2451.  
  2452.  Store the current date and time in a file, then save the output of a DIR 
  2453.  command in the same file: 
  2454.  
  2455.           echo Directory as of %_date %_time > dirsave
  2456.           dir >> dirsave
  2457.  
  2458.  Set up a prompt for the primary shell which displays the time and current 
  2459.  directory, and a different one for secondary shells which includes the shell 
  2460.  level rather than the time (see PROMPT for details about setting the prompt). 
  2461.  Also set different background colors for the two shells, without changing the 
  2462.  foreground color.  You might use a sequence like this in your 4START file (see 
  2463.  Automatic Batch Files): 
  2464.  
  2465.           iff %_shell==0 then
  2466.             prompt $t $p$g
  2467.             color %_fg on blue
  2468.           else
  2469.             prompt [$z] $p$g
  2470.             color %_fg on cyan
  2471.           endiff
  2472.  
  2473.  
  2474. ΓòÉΓòÉΓòÉ 11.1. ┬á? ΓòÉΓòÉΓòÉ
  2475.  
  2476. ? contains the exit code of the last external command.  Many programs return a 
  2477. "0" to indicate success and a non-zero value to signal an error.  However, not 
  2478. all programs return an exit code.  If no explicit exit code is returned, the 
  2479. value of %? is undefined. 
  2480.  
  2481.  
  2482. ΓòÉΓòÉΓòÉ 11.2. _? ΓòÉΓòÉΓòÉ
  2483.  
  2484. _? contains the exit code of the last internal command.  It is set to "0" if 
  2485. the command was successful, "1" if a usage error occurred, "2" if another 
  2486. command processor error or an operating system error occurred, or "3" if the 
  2487. command was interrupted by Ctrl-C or Ctrl-Break.  You must use or save this 
  2488. value immediately, because it is set by every internal command. 
  2489.  
  2490.  
  2491. ΓòÉΓòÉΓòÉ 11.3. = ΓòÉΓòÉΓòÉ
  2492.  
  2493. = returns the current escape character.  Use this variable, instead of the 
  2494. actual escape character, if you want your batch files and aliases to work 
  2495. regardless of how the escape character is defined.  For example, if the escape 
  2496. character is a caret [^] (the default in 4OS2) both of the commands below will 
  2497. send a form feed to the printer.  However, if the escape character has been 
  2498. changed,  the first command will send the string "^f" to the printer, while the 
  2499. second command will continue to work as intended. 
  2500.  
  2501.         echos ^f > prn
  2502.         echos %=f > prn
  2503.  
  2504.  
  2505. ΓòÉΓòÉΓòÉ 11.4. + ΓòÉΓòÉΓòÉ
  2506.  
  2507. + returns the current command separator.  Use this variable, instead of the 
  2508. actual command separator, if you want your batch files and aliases to work 
  2509. regardless of how the command separator is defined.  For example, if the 
  2510. command separator is an ampersand [&] (the default in 4OS2) both of the 
  2511. commands below will display "Hello" on one line and "world" on the next. 
  2512. However, if the command separator has been changed the first command will 
  2513. display "Hello & echo world", while the second command will continue to work as 
  2514. intended. 
  2515.  
  2516.         echo Hello & echo world
  2517.         echo Hello %+ echo world
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 11.5. _4VER ΓòÉΓòÉΓòÉ
  2521.  
  2522. _4VER is the current 4OS2 version (for example, "2.5"). The version number is 
  2523. in decimal and uses the appropriate decimal separator for your country (to 
  2524. allow numeric comparisons with the IF and IFF commands.) 
  2525.  
  2526.  
  2527. ΓòÉΓòÉΓòÉ 11.6. _ANSI ΓòÉΓòÉΓòÉ
  2528.  
  2529. _ANSI is always "1" in 4OS2.  (4OS2 enables OS/2's ANSI support, and assumes 
  2530. that it remains enabled.) 
  2531.  
  2532.  
  2533. ΓòÉΓòÉΓòÉ 11.7. _BATCH ΓòÉΓòÉΓòÉ
  2534.  
  2535. _BATCH is the current batch nesting level.  It is "0" if no batch file is 
  2536. currently being processed. 
  2537.  
  2538.  
  2539. ΓòÉΓòÉΓòÉ 11.8. _BATCHLINE ΓòÉΓòÉΓòÉ
  2540.  
  2541. _BATCHLINE is the current line number in the current batch file.  It is "-1" if 
  2542. no batch file is currently being processed. 
  2543.  
  2544.  
  2545. ΓòÉΓòÉΓòÉ 11.9. _BATCHNAME ΓòÉΓòÉΓòÉ
  2546.  
  2547. _BATCHNAME is the full pathname of the current batch file.  It is an empty 
  2548. string if no batch file is currently being processed. 
  2549.  
  2550.  
  2551. ΓòÉΓòÉΓòÉ 11.10. _BG ΓòÉΓòÉΓòÉ
  2552.  
  2553. _BG is a string containing the first three characters of the screen background 
  2554. color at the current cursor location (for example, "Bla"). 
  2555.  
  2556.  
  2557. ΓòÉΓòÉΓòÉ 11.11. _BOOT ΓòÉΓòÉΓòÉ
  2558.  
  2559. _BOOT is the boot drive letter, without a colon. 
  2560.  
  2561.  
  2562. ΓòÉΓòÉΓòÉ 11.12. _CI ΓòÉΓòÉΓòÉ
  2563.  
  2564. _CI is the current shape of the cursor in insert mode, as a percentage. 
  2565.  
  2566.  
  2567. ΓòÉΓòÉΓòÉ 11.13. _CO ΓòÉΓòÉΓòÉ
  2568.  
  2569. _CO is the current shape of the cursor in overstrike mode, as a percentage. 
  2570.  
  2571.  
  2572. ΓòÉΓòÉΓòÉ 11.14. _CODEPAGE ΓòÉΓòÉΓòÉ
  2573.  
  2574. _CODEPAGE is the current code page number (see CHCP). 
  2575.  
  2576.  
  2577. ΓòÉΓòÉΓòÉ 11.15. _COLUMN ΓòÉΓòÉΓòÉ
  2578.  
  2579. _COLUMN is the current cursor column (for example, "0" for the left side of the 
  2580. screen). 
  2581.  
  2582.  
  2583. ΓòÉΓòÉΓòÉ 11.16. _COLUMNS ΓòÉΓòÉΓòÉ
  2584.  
  2585. _COLUMNS is the current number of screen columns (for example, "80"). 
  2586.  
  2587.  
  2588. ΓòÉΓòÉΓòÉ 11.17. _COUNTRY ΓòÉΓòÉΓòÉ
  2589.  
  2590. _COUNTRY is the current country code. 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 11.18. _CPU ΓòÉΓòÉΓòÉ
  2594.  
  2595. _CPU is the CPU type: 
  2596.  
  2597.         86      8086 and 8088 
  2598.         186     80186 and 80188 
  2599.         200     NEC V20 and V30 
  2600.         286     80286 
  2601.         386     i386 
  2602.         486     i486 
  2603.         586     Pentium 
  2604.  
  2605.  
  2606. ΓòÉΓòÉΓòÉ 11.19. _CWD ΓòÉΓòÉΓòÉ
  2607.  
  2608. _CWD is the current working directory in the format d:\pathname. 
  2609.  
  2610.  
  2611. ΓòÉΓòÉΓòÉ 11.20. _CWDS ΓòÉΓòÉΓòÉ
  2612.  
  2613. _CWDS has the same value as CWD, except it ends the pathname with a backslash 
  2614. [\]. 
  2615.  
  2616.  
  2617. ΓòÉΓòÉΓòÉ 11.21. _CWP ΓòÉΓòÉΓòÉ
  2618.  
  2619. _CWP is the current working directory in the format \pathname. 
  2620.  
  2621.  
  2622. ΓòÉΓòÉΓòÉ 11.22. _CWPS ΓòÉΓòÉΓòÉ
  2623.  
  2624. _CWPS has the same value as CWP, except it ends the pathname with a backslash 
  2625. [\]. 
  2626.  
  2627.  
  2628. ΓòÉΓòÉΓòÉ 11.23. _DATE ΓòÉΓòÉΓòÉ
  2629.  
  2630. _DATE contains the current system date, in the format mm-dd-yy (U.S.), dd-mm-yy 
  2631. (Europe), or yy-mm-dd (Japan). 
  2632.  
  2633.  
  2634. ΓòÉΓòÉΓòÉ 11.24. _DAY ΓòÉΓòÉΓòÉ
  2635.  
  2636. _DAY is the day of the month (1 to 31). 
  2637.  
  2638.  
  2639. ΓòÉΓòÉΓòÉ 11.25. _DISK ΓòÉΓòÉΓòÉ
  2640.  
  2641. _DISK is the current disk drive, without a colon (for example, "C"). 
  2642.  
  2643.  
  2644. ΓòÉΓòÉΓòÉ 11.26. _DOS ΓòÉΓòÉΓòÉ
  2645.  
  2646. _DOS is the operating system type which may be useful if you have batch files 
  2647. running under more than one operating system. 
  2648.  
  2649.         Command Processor               _DOS return value 
  2650.  
  2651.         4DOS                            "DOS" 
  2652.         4DOS/NT                         "NT" 
  2653.         4OS2                            "OS2" 
  2654.         Take Command/16                 "WIN" 
  2655.         Take Command/32 (Win 95)        "WIN95" 
  2656.         Take Command/32 (Win NT)        "WIN32 
  2657.         Take Command for OS/2           "PM" 
  2658.  
  2659.  
  2660. ΓòÉΓòÉΓòÉ 11.27. _DNAME ΓòÉΓòÉΓòÉ
  2661.  
  2662. _DNAME is the name of the file used to store file descriptions.  It can be 
  2663. changed with the DescriptionName directive in 4OS2.INI or the SETDOS /D 
  2664. command. 
  2665.  
  2666.  
  2667. ΓòÉΓòÉΓòÉ 11.28. _DOSVER ΓòÉΓòÉΓòÉ
  2668.  
  2669. _DOSVER is the current operating system version (for example, "3.0").  The 
  2670. version number is in decimal and uses the appropriate decimal separator for 
  2671. your country (to allow numeric comparisons with the IF and IFF commands.) 
  2672.  
  2673.  
  2674. ΓòÉΓòÉΓòÉ 11.29. _DOW ΓòÉΓòÉΓòÉ
  2675.  
  2676. _DOW is the first three characters of the current day of the week ("Mon", 
  2677. "Tue", "Wed", etc.). 
  2678.  
  2679.  
  2680. ΓòÉΓòÉΓòÉ 11.30. _DOY ΓòÉΓòÉΓòÉ
  2681.  
  2682. _DOY is the day of the year (1 to 366). 
  2683.  
  2684.  
  2685. ΓòÉΓòÉΓòÉ 11.31. _FG ΓòÉΓòÉΓòÉ
  2686.  
  2687. _FG is a string containing the first three letters of the screen foreground 
  2688. color at the current cursor position (for example, "Whi"). 
  2689.  
  2690.  
  2691. ΓòÉΓòÉΓòÉ 11.32. _HLOGFILE ΓòÉΓòÉΓòÉ
  2692.  
  2693. _HLOGFILE  returns the name of the current history log file (or an empty string 
  2694. if LOG /H is OFF). 
  2695.  
  2696.  
  2697. ΓòÉΓòÉΓòÉ 11.33. _HOUR ΓòÉΓòÉΓòÉ
  2698.  
  2699. _HOUR is the current hour (0 - 23). 
  2700.  
  2701.  
  2702. ΓòÉΓòÉΓòÉ 11.34. _KBHIT ΓòÉΓòÉΓòÉ
  2703.  
  2704. _KBHIT returns 1 if one or more keystrokes are waiting in the keyboard buffer, 
  2705. or 0 if the keyboard buffer is empty. 
  2706.  
  2707.  
  2708. ΓòÉΓòÉΓòÉ 11.35. _LASTDISK ΓòÉΓòÉΓòÉ
  2709.  
  2710. _LASTDISK is the last valid drive letter, without a colon. 
  2711.  
  2712.  
  2713. ΓòÉΓòÉΓòÉ 11.36. _LOGFILE ΓòÉΓòÉΓòÉ
  2714.  
  2715. _LOGFILE  returns the name of the current log file (or an empty string if LOG 
  2716. is OFF). 
  2717.  
  2718.  
  2719. ΓòÉΓòÉΓòÉ 11.37. _MINUTE ΓòÉΓòÉΓòÉ
  2720.  
  2721. _MINUTE is the current minute (0 - 59). 
  2722.  
  2723.  
  2724. ΓòÉΓòÉΓòÉ 11.38. _MONITOR ΓòÉΓòÉΓòÉ
  2725.  
  2726. _MONITOR is the monitor type ("mono" or "color"). 
  2727.  
  2728.  
  2729. ΓòÉΓòÉΓòÉ 11.39. _MONTH ΓòÉΓòÉΓòÉ
  2730.  
  2731. _MONTH is the month of the year (1 to 12). 
  2732.  
  2733.  
  2734. ΓòÉΓòÉΓòÉ 11.40. _MOUSE ΓòÉΓòÉΓòÉ
  2735.  
  2736. _MOUSE always returns "1" in 4OS2. 
  2737.  
  2738.  
  2739. ΓòÉΓòÉΓòÉ 11.41. _NDP ΓòÉΓòÉΓòÉ
  2740.  
  2741. _NDP is the coprocessor type: 
  2742.  
  2743.         0       no coprocessor is installed 
  2744.         87      8087 
  2745.         287     80287 
  2746.         387     80387, 80486DX, or Pentium 
  2747.  
  2748.  
  2749. ΓòÉΓòÉΓòÉ 11.42. _PID ΓòÉΓòÉΓòÉ
  2750.  
  2751. _PID is the current process ID number. 
  2752.  
  2753.  
  2754. ΓòÉΓòÉΓòÉ 11.43. _PIPE ΓòÉΓòÉΓòÉ
  2755.  
  2756. _PIPE returns 1 if the current process is running inside a pipe or 0 otherwise. 
  2757.  
  2758.  
  2759. ΓòÉΓòÉΓòÉ 11.44. _PPID ΓòÉΓòÉΓòÉ
  2760.  
  2761. _PPID is the process ID number of the parent process. 
  2762.  
  2763.  
  2764. ΓòÉΓòÉΓòÉ 11.45. _PTYPE ΓòÉΓòÉΓòÉ
  2765.  
  2766. _PTYPE is the current OS/2 process type: 
  2767.  
  2768.         AVIO    Character mode, windowed 
  2769.         DT      Detached (no screen in use) 
  2770.         FS      Character mode, full-screen 
  2771.         PM      Presentation Manager 
  2772.  
  2773.  
  2774. ΓòÉΓòÉΓòÉ 11.46. _ROW ΓòÉΓòÉΓòÉ
  2775.  
  2776. _ROW is the current cursor row (for example, "0" for the top of the screen). 
  2777.  
  2778.  
  2779. ΓòÉΓòÉΓòÉ 11.47. _ROWS ΓòÉΓòÉΓòÉ
  2780.  
  2781. _ROWS is the current number of screen rows (for example, "25"). 
  2782.  
  2783.  
  2784. ΓòÉΓòÉΓòÉ 11.48. _SECOND ΓòÉΓòÉΓòÉ
  2785.  
  2786. _SECOND is the current second (0 - 59). 
  2787.  
  2788.  
  2789. ΓòÉΓòÉΓòÉ 11.49. _SHELL ΓòÉΓòÉΓòÉ
  2790.  
  2791. _SHELL is the current shell nesting level.  The primary shell is level "0", and 
  2792. each subsequent secondary shell increments the level by 1. 
  2793.  
  2794.  
  2795. ΓòÉΓòÉΓòÉ 11.50. _SID ΓòÉΓòÉΓòÉ
  2796.  
  2797. _SID is the session ID number. 
  2798.  
  2799.  
  2800. ΓòÉΓòÉΓòÉ 11.51. _SYSERR ΓòÉΓòÉΓòÉ
  2801.  
  2802. _SYSERR is the error code of the last operating system error. You will need a 
  2803. technical or programmer's manual to understand these error values. 
  2804.  
  2805.  
  2806. ΓòÉΓòÉΓòÉ 11.52. _TIME ΓòÉΓòÉΓòÉ
  2807.  
  2808. _TIME contains the current system time in the format hh:mm:ss. The separator 
  2809. character may vary depending upon your country information. 
  2810.  
  2811.  
  2812. ΓòÉΓòÉΓòÉ 11.53. _TRANSIENT ΓòÉΓòÉΓòÉ
  2813.  
  2814. _TRANSIENT is "1" if the current shell is transient (started with a /C, see 
  2815. Startup Options for details), or "0" otherwise. 
  2816.  
  2817.  
  2818. ΓòÉΓòÉΓòÉ 11.54. _VIDEO ΓòÉΓòÉΓòÉ
  2819.  
  2820. _VIDEO is the video card type ("mono", "cga", "ega", "vga", "xga", "8514", or 
  2821. "IA/A"). 
  2822.  
  2823.  
  2824. ΓòÉΓòÉΓòÉ 11.55. _WINTITLE ΓòÉΓòÉΓòÉ
  2825.  
  2826. _WINTITLE returns the title of the current window. 
  2827.  
  2828.  
  2829. ΓòÉΓòÉΓòÉ 11.56. _YEAR ΓòÉΓòÉΓòÉ
  2830.  
  2831. _YEAR is the current year (1980 to 2099). 
  2832.  
  2833.  
  2834. ΓòÉΓòÉΓòÉ 12. Variable Functions ΓòÉΓòÉΓòÉ
  2835.  
  2836. Variable functions are like internal variables, but they take one or more 
  2837. arguments (which can be environment variables or even other variable functions) 
  2838. and they return a value. 
  2839.  
  2840. The list below gives a one-line description of each function, and a 
  2841. cross-reference which selects a full screen help topic on that function.  A few 
  2842. of the variables are simple enough that the one-line description is sufficient, 
  2843. but in most cases you should check for any additional information in the 
  2844. cross-reference topic if you are not already familiar with a function.  You can 
  2845. also obtain help on any function with a HELP @functionname command at the 
  2846. prompt. 
  2847.  
  2848. See the discussion after the function list for additional information and 
  2849. examples. 
  2850.  
  2851. The variable functions are: 
  2852.  
  2853. System status 
  2854.  
  2855.         @DOSMEM[b|k|m]                      Size of largest free memory block 
  2856.         @READSCR[row,col,len]               Read characters from the screen 
  2857.  
  2858.  Drives and devices 
  2859.  
  2860.         @CDROM[d:]                          CD-ROM drive detection (0 or 1) 
  2861.         @DEVICE[name]                       Character device detection 
  2862.         @DISKFREE[d:,b|k|m]                 Free disk space 
  2863.         @DISKTOTAL[d:,b|k|m]                Total disk space 
  2864.         @DISKUSED[d:,b|k|m]                 Used disk space 
  2865.         @FSTYPE[d:]                         File system type (FAT, HPFS, CDFS, 
  2866.                                             etc.) 
  2867.         @LABEL[d:]                          Volume label 
  2868.         @READY[d:]                          Drive ready status (0 or 1) 
  2869.         @REMOTE[d:]                         Remote (network) drive detection (0 
  2870.                                             or 1) 
  2871.         @REMOVABLE[d:]                      Removable drive detection (0 or 1) 
  2872.  
  2873.  Files 
  2874.  
  2875.         @ATTRIB[filename,[nrhsda]]          File attribute test (0 or 1) 
  2876.         @DESCRIPT[filename]                 File description 
  2877.         @EXETYPE[filename]                  Executable file type (DOS, PM, WIN, 
  2878.                                             etc.) 
  2879.         @FILEAGE[filename]                  File age (date and time) 
  2880.         @FILECLOSE[n]                       Close a file 
  2881.         @FILEDATE[filename]                 File date 
  2882.         @FILEOPEN[filename,mode]            Open a file 
  2883.         @FILEREAD[n [,length]]              Read next line from a file 
  2884.         @FILES[filename [, -nrhsda]]        Count files matching a wildcard 
  2885.         @FILESEEK[n,offset,start]           Move a file pointer to an offset 
  2886.         @FILESEEKL[n,offset,start]          Move a file pointer to a line 
  2887.                                             number 
  2888.         @FILESIZE[filename,b|k|m]           Size of files matching a wildcard 
  2889.         @FILETIME[filename]                 File time 
  2890.         @FILEWRITE[n,text]                  Write next line to a file 
  2891.         @FILEWRITEB[n,length,string]        Write bytes from a string to a file 
  2892.         @FINDFIRST[filename,nrhsda]         Find first matching file 
  2893.         @FINDNEXT[filename,nrhsda]          Find next matching file 
  2894.         @LINE[filename,n]                   Read a random line from a file 
  2895.         @LINES[filename]                    Count lines in a file 
  2896.         @SEARCH[filename]                   Path search 
  2897.         @UNIQUE[d:\path]                    Create file with unique name 
  2898.  
  2899.  File names 
  2900.  
  2901.         @EXT[filename]                      File extension 
  2902.         @FILENAME[filename]                 File name and extension 
  2903.         @FULL[filename]                     Full file name with path 
  2904.         @NAME[filename]                     File name without path or extension 
  2905.         @PATH[filename]                     File path without name 
  2906.  
  2907.  Strings and characters 
  2908.  
  2909.         @ASCII[c]                           Numeric ASCII value for a character 
  2910.         @CHAR[n]                            Character value for numeric ASCII 
  2911.         @FORMAT[[-][x][.y],string]          Formats (justifies) a string 
  2912.         @INDEX[string1,string2]             Position of one string in another 
  2913.         @INSTR[start,length,string]         Extract a substring 
  2914.         @LEN[string]                        Length of a string 
  2915.         @LOWER[string]                      Convert string to lower case 
  2916.         @ REPEAT[c,n]                       Repeat a character 
  2917.         @SUBSTR[string,start,length]        Extract a substring 
  2918.         @TRIM[string]                       Remove blanks from a string 
  2919.         @UPPER[string]                      Convert string to upper case 
  2920.         @WORD[["sep",]n,string]             Extract a word from a string 
  2921.         @WORDS[["sep",]string]              Counts number of words in a string 
  2922.  
  2923.  Numbers and arithmetic 
  2924.  
  2925.         @COMMA[n]                           Inserts commas in a number 
  2926.         @DEC[%var]                          Decremented value of a variable 
  2927.         @EVAL[expression]                   Arithmetic calculations 
  2928.         @INC[%var]                          Incremented value of a variable 
  2929.         @INT[n]                             Integer part of a number 
  2930.         @NUMERIC[string]                    Test if a string is numeric 
  2931.         @RANDOM[min,max]                    Generate a random integer 
  2932.  
  2933.  Dates and times 
  2934.  
  2935.         @DATE[mm-dd-yy]                     Convert date to number of days 
  2936.         @MAKEAGE[n]                         Convert date/time to file date/time 
  2937.         @MAKEDATE[n]                        Convert number of days to date 
  2938.         @MAKETIME[n]                        Convert number of seconds to time 
  2939.         @TIME[hh:mm:ss]                     Convert time to number of seconds 
  2940.         @TIMER[n]                           Elapsed time of specified timer 
  2941.  
  2942.  Utility 
  2943.  
  2944.         @ALIAS[name]                        Value of an alias 
  2945.         @IF[condition,true,false]           Evaluates a test condition 
  2946.         @EXEC[command]                      Execute a command 
  2947.         @REXX[expr]                         Execute a REXX expression 
  2948.         @SELECT[file,t,l,b,r,title]         Menu selection 
  2949.  
  2950.  Like all environment variables, these variable functions must be preceded by a 
  2951.  percent sign (%@EVAL, %@LEN, etc.).  All variable functions must have square 
  2952.  brackets enclosing their argument(s).  The argument(s) to a variable function 
  2953.  cannot exceed 255 characters in length for all arguments taken as a group. 
  2954.  
  2955.  Some variable functions, like @DISKFREE, are shown with "b|k|m" as one of 
  2956.  their arguments.  Those functions return a number of bytes, kilobytes, or 
  2957.  megabytes based on the "b|k|m" argument: 
  2958.  
  2959.         b   return the number of bytes 
  2960.         K   return the number of kilobytes (bytes / 1,024) 
  2961.         k   return the number of thousands of bytes (bytes / 1,000) 
  2962.         M   return the number of megabytes (bytes / 1,048,576) 
  2963.         m   return the number of millions of bytes (bytes / 1,000,000) 
  2964.  
  2965.  You can include commas in the results from a "b|k|m" function by appending a 
  2966.  "c" to the argument.  For example, to add commas to a "b" or number of bytes 
  2967.  result, enter "bc" as the argument. 
  2968.  
  2969.  In variable functions which take a drive letter as an argument, like @DISKFREE 
  2970.  or @READY, the drive letter must be followed by a colon.  The function will 
  2971.  not work properly if you use the drive letter without the colon. 
  2972.  
  2973.  The @FILEREAD, @FILEWRITE, @FILESEEK, and @FILECLOSE functions allow you to 
  2974.  access files based on their file handle.  These functions should only be used 
  2975.  with file handles returned by @FILEOPEN!  If you use them with any other file 
  2976.  handle you may damage other files opened by 4OS2 (or, in a secondary shell, 
  2977.  the program which started 4OS2), or hang your system. 
  2978.  
  2979.  Examples 
  2980.  
  2981.  You can use variable functions in a wide variety of ways depending on your 
  2982.  needs.  We've included a few examples below to give you an idea of what's 
  2983.  possible. 
  2984.  
  2985.  To set the prompt to show the amount of free memory (see PROMPT for details on 
  2986.  including variable functions in your prompt): 
  2987.  
  2988.           [c:\] prompt (%%@dosmem[K]K) $p$g
  2989.  
  2990.  Set up a simple command-line calculator.  The calculator is used with a 
  2991.  command like CALC 3 * (4 + 5): 
  2992.  
  2993.           [c:\] alias calc `echo The answer is:  %@eval[%&]`
  2994.  
  2995.  The following batch file uses variable functions to implement "once a day" 
  2996.  execution of a group of commands.  It works by constructing a 6-digit number 
  2997.  "yymmdd" from today's date, and comparing that to a number of the same type 
  2998.  stored in the file C:\ONCEADAY.DAT. If today's date is numerically larger than 
  2999.  the saved date, and the time is after 6:00 AM, then the "once a day" commands 
  3000.  are run, and today's date is saved in the file as the new date for comparison. 
  3001.  Otherwise, no action is taken.  You can make this file simpler using the 
  3002.  %@DATE and %@TIME functions instead of using %@SUBSTR to extract substrings of 
  3003.  the %_DATE and %_TIME variables; we used the approach shown to demonstrate the 
  3004.  use of %@SUBSTR. 
  3005.  
  3006.           rem  Temporary variables used to shorten example lines:
  3007.           rem    DD is _date, DY is yymmdd date, TM is _time
  3008.           set dd=%_date
  3009.           set dy=%@substr[%dd,6,2]%@substr[%dd,0,2]%@substr[%dd,3,2]
  3010.           set lastdate=0
  3011.           iff exist c:\onceaday.dat then
  3012.              set lastdate=%@line[onceaday.dat,0]
  3013.           endiff
  3014.           iff %dy gt %lastdate then
  3015.              set tm=%_time
  3016.              iff "%@substr[%tm,0,2]%@substr[%tm,3,2]" gt "0600" then
  3017.                 rem Commands to be executed once a day go here
  3018.                 echo %dy > c:\onceaday.dat
  3019.              endiff
  3020.           endiff
  3021.  
  3022.  
  3023. ΓòÉΓòÉΓòÉ 12.1. @ALIAS ΓòÉΓòÉΓòÉ
  3024.  
  3025. @ALIAS[name]:  Returns the contents of the specified alias as a string, or a 
  3026. null string if the alias doesn't exist.  When manipulating strings returned by 
  3027. @ALIAS you may need to disable certain special characters with the SETDOS /X 
  3028. command. Otherwise, command separators, redirection characters, and other 
  3029. similar "punctuation" in the alias may be interpreted as part of the current 
  3030. command, rather than part of a simple text string. 
  3031.  
  3032.  
  3033. ΓòÉΓòÉΓòÉ 12.2. @ASCII ΓòÉΓòÉΓòÉ
  3034.  
  3035. @ASCII[c]:  Returns the numeric value of the specified ASCII character as a 
  3036. string.  For example %@ASCII[A] returns 65.  You can put an escape character 
  3037. [^] before the actual character to process.  This allows quotes and other 
  3038. special characters as the argument (e.g., %@ASCII[^`]). 
  3039.  
  3040.  
  3041. ΓòÉΓòÉΓòÉ 12.3. @ATTRIB ΓòÉΓòÉΓòÉ
  3042.  
  3043. @ATTRIB[filename,[nrhsda]]:  Returns a "1" if the specified file has the 
  3044. matching attribute(s); otherwise returns a "0".  The attributes are: 
  3045.  
  3046.         N   Normal (no attributes set) 
  3047.         R   Read-only 
  3048.         H   Hidden 
  3049.         S   System 
  3050.         D   Directory 
  3051.         A   Archive 
  3052.  
  3053.  The attributes (other than N) can be combined (for example 
  3054.  %@ATTRIB[MYFILE,HS]).  Normally ATTRIB will only return a "1" if all of the 
  3055.  attributes match.  However, if a final ,p is included (for partial match), 
  3056.  then @ATTRIB will return a "1" if any of the attributes match.  For example, 
  3057.  %@ATTRIB[MYFILE,HS,p] will return a "1" if MYFILE has the hidden, system, or 
  3058.  both attributes.  Without ,p the function will return a "1" only if MYFILE has 
  3059.  both attributes. 
  3060.  
  3061.  If you do not specify any attributes, @ATTRIB will return the attributes of 
  3062.  the specified file in the format RHSAD, rather than a "0" or "1".  Attributes 
  3063.  which are not set will be replaced with an underscore.  For example, if 
  3064.  SECURE.DAT has the read-only, hidden, and archive attributes set, 
  3065.  %@ATTRIB[SECURE.DAT] would return RH_A_. 
  3066.  
  3067.  
  3068. ΓòÉΓòÉΓòÉ 12.4. @CDROM ΓòÉΓòÉΓòÉ
  3069.  
  3070. @CDROM[d:]:  Returns "1" if the drive is a CD-ROM or "0" otherwise. 
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 12.5. @CHAR ΓòÉΓòÉΓòÉ
  3074.  
  3075. @CHAR[n]:  Returns the character corresponding to an ASCII numeric value.  For 
  3076. example %@CHAR[65] returns A. 
  3077.  
  3078.  
  3079. ΓòÉΓòÉΓòÉ 12.6. @DATE ΓòÉΓòÉΓòÉ
  3080.  
  3081. @DATE[mm-dd-yy]:  Returns the number of days since January 1, 1980 for the 
  3082. specified date.  DATE uses the date format and separators mandated by your 
  3083. country code (for example dd.mm.yy in Germany, or  yy-mm-dd in Japan). 
  3084.  
  3085.  
  3086. ΓòÉΓòÉΓòÉ 12.7. @COMMA ΓòÉΓòÉΓòÉ
  3087.  
  3088. @COMMA[n]:  Inserts commas, or the "thousands separator" character for your 
  3089. country ID, into a numeric string. 
  3090.  
  3091.  
  3092. ΓòÉΓòÉΓòÉ 12.8. @DEC ΓòÉΓòÉΓòÉ
  3093.  
  3094. @DEC[%var]:  Returns the same value as @EVAL[%var - 1].  That is, it retrieves 
  3095. and decrements the value of a variable.  The variable itself is not changed; to 
  3096. do so, use a command like this: 
  3097.  
  3098.         set var=%@dec[%var]
  3099.  
  3100.  
  3101. ΓòÉΓòÉΓòÉ 12.9. @DESCRIPT ΓòÉΓòÉΓòÉ
  3102.  
  3103. @DESCRIPT[filename]:  Returns the file description for the specified filename 
  3104. (see DESCRIBE). 
  3105.  
  3106.  
  3107. ΓòÉΓòÉΓòÉ 12.10. @DEVICE ΓòÉΓòÉΓòÉ
  3108.  
  3109. @DEVICE[name]:  Returns "1" if the specified name is a character device (such 
  3110. as a printer or serial port), or "0" if not. 
  3111.  
  3112.  
  3113. ΓòÉΓòÉΓòÉ 12.11. @DISKFREE ΓòÉΓòÉΓòÉ
  3114.  
  3115. @DISKFREE[d:,b|k|m]: Returns the amount of free disk space on the specified 
  3116. drive. 
  3117.  
  3118.  
  3119. ΓòÉΓòÉΓòÉ 12.12. @DISKTOTAL ΓòÉΓòÉΓòÉ
  3120.  
  3121. @DISKTOTAL[d:,b|k|m]:  Returns the total disk space on the specified drive. 
  3122.  
  3123.  
  3124. ΓòÉΓòÉΓòÉ 12.13. @DISKUSED ΓòÉΓòÉΓòÉ
  3125.  
  3126. @DISKUSED[d:,b|k|m]:  Returns the amount of disk space in use by files and 
  3127. directories on the specified drive. 
  3128.  
  3129.  
  3130. ΓòÉΓòÉΓòÉ 12.14. @DOSMEM ΓòÉΓòÉΓòÉ
  3131.  
  3132. @DOSMEM[b|k|m]:  Returns the size of the largest free memory block (either in 
  3133. physical or virtual memory). 
  3134.  
  3135.  
  3136. ΓòÉΓòÉΓòÉ 12.15. @EVAL ΓòÉΓòÉΓòÉ
  3137.  
  3138. @EVAL[expression]:  Evaluates an arithmetic expression.  @EVAL supports 
  3139. addition (+), subtraction (-), multiplication (*), division (/), integer 
  3140. division (\, returns the integer part of the quotient), modulo (%%), and 
  3141. integer exponentiation (**).  The expression can contain environment variables 
  3142. and other variable functions.  @EVAL also supports parentheses, commas, and 
  3143. decimals.  Parentheses can be nested.  @EVAL will strip leading and trailing 
  3144. zeros from the result. When evaluating expressions, **, *, /, and %% take 
  3145. precedence over + and -.  For example, 3 + 4 * 2 will be interpreted as 3 + 8, 
  3146. not as 7 * 2.  To change this order of evaluation, use parentheses to specify 
  3147. the order you want. Also see @DEC and @INC. 
  3148.  
  3149. To ensure that your @EVAL expressions are interpreted correctly, spaces should 
  3150. be placed on both sides of an operator.  For example: 
  3151.  
  3152.         @eval[20 %% 3 + 4]
  3153.  
  3154. The maximum precision is 16 digits to the left of the decimal point and 8 
  3155. digits to the right of the decimal point.  You can alter the default precision 
  3156. to the right of the decimal point with the EvalMax and EvalMin directives in 
  3157. 4OS2.INI and with the SETDOS /F command. 
  3158.  
  3159. You can alter the precision for a single evaluation with the construct 
  3160. @EVAL[expression=x.y].  The x value specifies the minimum decimal precision 
  3161. (i.e., the minimum number of decimal places displayed); the y value sets the 
  3162. maximum decimal precision.  If x is greater than y, it is ignored.  You can 
  3163. specify either or both arguments, for example%colon. 
  3164.  
  3165.         @eval[3/7=2]            returns 0.42857143
  3166.         @eval[3/7=.4]           returns 0.4286
  3167.         @eval[3/6=2.4]          returns 0.50
  3168.  
  3169.  
  3170. ΓòÉΓòÉΓòÉ 12.16. @EXEC ΓòÉΓòÉΓòÉ
  3171.  
  3172. @EXEC[command]:  Execute the command and return the numeric exit code.  The 
  3173. command can be an alias, internal command, external command, .BTM file, or .BAT 
  3174. file.  @EXEC is primarily intended for running a program from within the 
  3175. PROMPT.  It is a "back door" entry into command processing and should be used 
  3176. with extreme caution.  Incorrect or recursive use of @EXEC may hang your 
  3177. system. 
  3178.  
  3179.  
  3180. ΓòÉΓòÉΓòÉ 12.17. @EXETYPE ΓòÉΓòÉΓòÉ
  3181.  
  3182. @EXETYPE[filename]:  Returns the application type as a string: 
  3183.  
  3184.         DOS         DOS .COM, .EXE, or .BAT file (OS/2 2.x and above only) 
  3185.         AVIO        OS/2 Character mode, windowed 
  3186.         FS          OS/2 Character mode, full-screen 
  3187.         PM          OS/2 Presentation Manager 
  3188.         WIN         Windows 3 (OS/2 2.x and above only) 
  3189.         UNKNOWN     Any other file 
  3190.  
  3191.  
  3192. ΓòÉΓòÉΓòÉ 12.18. @EXT ΓòÉΓòÉΓòÉ
  3193.  
  3194. @EXT[filename]:  Returns the extension (up to 64 characters) from a file name, 
  3195. without a leading period. 
  3196.  
  3197.  
  3198. ΓòÉΓòÉΓòÉ 12.19. @FILEAGE ΓòÉΓòÉΓòÉ
  3199.  
  3200. @FILEAGE[filename]:  Returns the date and time of the file as a single numeric 
  3201. value.  The number can be used to compare the relative ages of two or more 
  3202. files. 
  3203.  
  3204.  
  3205. ΓòÉΓòÉΓòÉ 12.20. @FILECLOSE ΓòÉΓòÉΓòÉ
  3206.  
  3207. @FILECLOSE[n]:  Closes the file whose handle is "n."  You cannot close handles 
  3208. 0, 1 or 2.  Returns "0" if the file closed OK or "-1" if an error occurred.  Be 
  3209. sure to read the cautionary note about file functions under Variable Functions. 
  3210.  
  3211.  
  3212. ΓòÉΓòÉΓòÉ 12.21. @FILEDATE ΓòÉΓòÉΓòÉ
  3213.  
  3214. @FILEDATE[filename]:  Returns the date a file was last modified, in the default 
  3215. country format (mm-dd-yy for the US). 
  3216.  
  3217.  
  3218. ΓòÉΓòÉΓòÉ 12.22. @FILENAME ΓòÉΓòÉΓòÉ
  3219.  
  3220. @FILENAME[filename]:  Returns the name and extension of a file, without a path. 
  3221.  
  3222.  
  3223. ΓòÉΓòÉΓòÉ 12.23. @FILEOPEN ΓòÉΓòÉΓòÉ
  3224.  
  3225. @FILEOPEN[filename, read | write | append, [b | t]]:  Opens the file in the 
  3226. specified mode and returns the file handle as an integer.  Returns "-1" if the 
  3227. file cannot be opened. 
  3228.  
  3229. The optional third parameter controls whether the file is opened in binary mode 
  3230. ("b") or text mode ("t").  Text mode (the default) should be used to read text 
  3231. using @FILEREAD without a "length" parameter, and to write text using 
  3232. @FILEWRITE.  Binary mode should be used to read binary data with @FILEREAD with 
  3233. a "length" parameter, and to write binary data with @FILEWRITEB. 
  3234.  
  3235. Be sure to read the cautionary note about file functions under Variable 
  3236. Functions. 
  3237.  
  3238. @FILEOPEN can also open named pipes.  The pipe name must begin with \\.\pipe\. 
  3239. @FILEOPEN first tries to open an existing pipe; if that fails it tries to 
  3240. create a new pipe.  Pipes are opened in blocking mode, duplex access, byte-read 
  3241. mode, and inheritable.  For more information on named pipes see your OS/2 
  3242. documentation. 
  3243.  
  3244.  
  3245. ΓòÉΓòÉΓòÉ 12.24. @FILEREAD ΓòÉΓòÉΓòÉ
  3246.  
  3247. @FILEREAD[n [,length]]: Reads data from the file whose handle is "n."  Returns 
  3248. "**EOF**" if you attempt to read past the end of the file.  If "length" is not 
  3249. specified @FILEREAD will read until the next CR or LF (end of line) character. 
  3250. If "length" is specified, @FILEREAD will read "length" bytes regardless of any 
  3251. end of line characters. 
  3252.  
  3253. If you plan to read text a line at a time, without using "length", you should 
  3254. open the file in text mode.  If you plan to read binary data using "length", 
  3255. you should open the file in binary mode.  See @FILEOPEN for details on opening 
  3256. the file in the proper mode. 
  3257.  
  3258. Be sure to read the cautionary note about file functions under Variable 
  3259. Functions. 
  3260.  
  3261.  
  3262. ΓòÉΓòÉΓòÉ 12.25. @FILES ΓòÉΓòÉΓòÉ
  3263.  
  3264. @FILES[filename [, -nrhsda]]:  Returns the number of files that match the 
  3265. filename specification, which may contain wildcards and include lists.  Returns 
  3266. an empty string if no files match.  The filename must refer to a single 
  3267. directory; to check several directories, use @FILES once for each directory, 
  3268. and add the results together with @EVAL. 
  3269.  
  3270. The second argument is a list of file attributes.  If it is included, only 
  3271. those files matching all the specified attributes are counted.  The attributes 
  3272. are: 
  3273.  
  3274.         N   Normal (no attributes set) 
  3275.         R   Read-only 
  3276.         H   Hidden 
  3277.         S   System 
  3278.         D   Directory 
  3279.         A   Archive 
  3280.  
  3281.   You can prefix an attribute with - to mean "everything except files with this 
  3282.  attribute." 
  3283.  
  3284.  
  3285. ΓòÉΓòÉΓòÉ 12.26. @FILESEEK ΓòÉΓòÉΓòÉ
  3286.  
  3287. @FILESEEK[n,offset,start]:  Moves the file pointer "offset" bytes in the file 
  3288. whose handle is "n".  Returns the new position of the pointer, in bytes from 
  3289. the start of the file.  Set "start" to 0 to seek relative to the beginning of 
  3290. the file, 1 to seek relative to the current file pointer, or 2 to seek relative 
  3291. to the end of the file.  The offset value may be negative (seek backward), 
  3292. positive (seek forward), or zero (return current position, but do not change 
  3293. it).  Be sure to read the cautionary note about file functions under Variable 
  3294. Functions. 
  3295.  
  3296.  
  3297. ΓòÉΓòÉΓòÉ 12.27. @FILESEEKL ΓòÉΓòÉΓòÉ
  3298.  
  3299. @FILESEEKL[n,line]:  Moves the file pointer to the specified line in the file 
  3300. whose handle is "n". Returns the new position of the pointer, in bytes from the 
  3301. start of the file. Be sure to read the cautionary note about file functions 
  3302. under Variable Functions. 
  3303.  
  3304.  
  3305. ΓòÉΓòÉΓòÉ 12.28. @FILESIZE ΓòÉΓòÉΓòÉ
  3306.  
  3307. @FILESIZE[filename,b|k|m]:  Returns the size of a file, or "-1" if the file 
  3308. does not exist.  If the filename includes wildcards or an include list, returns 
  3309. the combined size of all matching files. 
  3310.  
  3311.  
  3312. ΓòÉΓòÉΓòÉ 12.29. @FILETIME ΓòÉΓòÉΓòÉ
  3313.  
  3314. @FILETIME[filename]:  Returns the time a file was last modified, in hh:mm 
  3315. format. 
  3316.  
  3317.  
  3318. ΓòÉΓòÉΓòÉ 12.30. @FILEWRITE ΓòÉΓòÉΓòÉ
  3319.  
  3320. @FILEWRITE[n,text]:  Writes a line to the file whose handle is "n".  Returns 
  3321. the number of bytes written, or "-1" if an error occurred. 
  3322.  
  3323. If you plan to write text a line at a time with @FILEWRITE, you should open the 
  3324. file in text mode (see @FILEOPEN).  If you want to write binary data you should 
  3325. use @FILEWRITEB instead, and open the file in binary mode. 
  3326.  
  3327. Be sure to read the cautionary note about file functions under Variable 
  3328. Functions. 
  3329.  
  3330.  
  3331. ΓòÉΓòÉΓòÉ 12.31. @FILEWRITEB ΓòÉΓòÉΓòÉ
  3332.  
  3333. @FILEWRITEB[n,length,string]:  Writes the specified number of bytes from the 
  3334. string to the file whose handle is "n".  Returns the number of bytes written, 
  3335. or "-1" if an error occurred. 
  3336.  
  3337. If you plan to write binary data with @FILEWRITEB, you should open the file in 
  3338. binary mode (see @FILEOPEN).  If you want to write text a line at a time you 
  3339. should use @FILEWRITE instead, and open the file in text mode. 
  3340.  
  3341. Be sure to read the cautionary note about file functions under Variable 
  3342. Functions. 
  3343.  
  3344.  
  3345. ΓòÉΓòÉΓòÉ 12.32. @FINDFIRST ΓòÉΓòÉΓòÉ
  3346.  
  3347. @FINDFIRST[filename [,nrhsda]]:  Returns the name of the first file that 
  3348. matches the filename, which may contain wildcards and "include lists."  The 
  3349. second argument, if included, defines the attributes of the files that will be 
  3350. included in the search.  Returns an empty string if no files match.  The 
  3351. attributes are: 
  3352.  
  3353.         N   Normal (no attributes set) 
  3354.         R   Read-only 
  3355.         H   Hidden 
  3356.         S   System 
  3357.         D   Directory 
  3358.         A   Archive 
  3359.  
  3360.  @FINDFIRST always skips the "." and ".." entries when processing directory 
  3361.  names. 
  3362.  
  3363.  The attributes (other than N) can be combined (for example 
  3364.  %@FINDFIRST[MYFILE,HS]).  @FINDFIRST will only find a file if all of the 
  3365.  attributes match. 
  3366.  
  3367.  
  3368. ΓòÉΓòÉΓòÉ 12.33. @FINDNEXT ΓòÉΓòÉΓòÉ
  3369.  
  3370. @FINDNEXT[filename [,nrhsda]]:  Returns the name of the next file that matches 
  3371. the filename passed to @FINDFIRST. @FINDNEXT should only be used after a 
  3372. successful call to @FINDFIRST.  The first argument is included for 
  3373. compatibility with previous versions, but is ignored; it can be omitted if the 
  3374. second argument is not used (e.g. %@FINDNEXT[]).  The second argument, if 
  3375. included, defines the attributes of the files that will be included in the 
  3376. search (see @FINDFIRST for details).  Returns an empty string when no more 
  3377. files match 
  3378.  
  3379. @FINDNEXT always skips the "." and ".." entries when processing directory 
  3380. names. 
  3381.  
  3382.  
  3383. ΓòÉΓòÉΓòÉ 12.34. @FORMAT ΓòÉΓòÉΓòÉ
  3384.  
  3385. @FORMAT[[-][x][.y],string]:  Reformats a string, truncating it or padding it 
  3386. with spaces as necessary.  If you use the minus [-], the string is 
  3387. left-justified; otherwise, it is right-justified.  The "x" value is the minimum 
  3388. number of characters in the result.  The "y" value is the maximum number of 
  3389. characters in the result.  You can combine the options as necessary.  For 
  3390. example: 
  3391.  
  3392.         %@format[12,JPSoftware]         returns "  JPSoftware"
  3393.         %@format[.3,JPSoftware]         returns "JPS"
  3394.  
  3395.  
  3396. ΓòÉΓòÉΓòÉ 12.35. @FSTYPE ΓòÉΓòÉΓòÉ
  3397.  
  3398. @FSTYPE[d:]:  Returns the file system type for the specified drive.  @FSTYPE 
  3399. will return "FAT" for a DOS-compatible drive with a file allocation table, 
  3400. "HPFS" for a drive that uses OS/2's high performance file system, or "CDFS" for 
  3401. a CD-ROM drive.  It may return other values if additional file systems have 
  3402. been installed with the IFS= directive in CONFIG.SYS. 
  3403.  
  3404.  
  3405. ΓòÉΓòÉΓòÉ 12.36. @FULL ΓòÉΓòÉΓòÉ
  3406.  
  3407. @FULL[filename]:  Returns the fully qualified path name of a file. 
  3408.  
  3409.  
  3410. ΓòÉΓòÉΓòÉ 12.37. @IF ΓòÉΓòÉΓòÉ
  3411.  
  3412. @IF[condition,true,false]:  Evaluates the condition and returns a string based 
  3413. on the result.  The condition can include any of the tests allowed in the IF 
  3414. command.  If the condition is true, @IF returns the first result string; if it 
  3415. is false, @IF returns the second string.  For example, "%@IF 
  3416. [2==2,Correct!,Oops!]" returns "Correct!" 
  3417.  
  3418.  
  3419. ΓòÉΓòÉΓòÉ 12.38. @INC ΓòÉΓòÉΓòÉ
  3420.  
  3421. @INC[%var]:  Returns the same value as %@EVAL[%var + 1].  That is, it retrieves 
  3422. and increments the value of a variable.  The variable itself is not changed; to 
  3423. do so, use a command like this: 
  3424.  
  3425.         set var=%@inc[%var]
  3426.  
  3427.  
  3428. ΓòÉΓòÉΓòÉ 12.39. @INDEX ΓòÉΓòÉΓòÉ
  3429.  
  3430. @INDEX[string1,string2]:  Returns the position of string2 within string1, or 
  3431. "-1" if string2 is not found.  The first position in string1 is numbered 0. 
  3432.  
  3433.  
  3434. ΓòÉΓòÉΓòÉ 12.40. @INSTR ΓòÉΓòÉΓòÉ
  3435.  
  3436. @INSTR[start, length, string]:  The same as @SUBSTR.  However, the string is at 
  3437. the end of the @INSTR argument list, so that commas in the string will not be 
  3438. confused with commas separating the arguments. 
  3439.  
  3440.  
  3441. ΓòÉΓòÉΓòÉ 12.41. @INT ΓòÉΓòÉΓòÉ
  3442.  
  3443. @INT[n]:  Returns the integer part of the number n. 
  3444.  
  3445.  
  3446. ΓòÉΓòÉΓòÉ 12.42. @LABEL ΓòÉΓòÉΓòÉ
  3447.  
  3448. @LABEL[d:]:  Returns the volume label of the specified disk drive. 
  3449.  
  3450.  
  3451. ΓòÉΓòÉΓòÉ 12.43. @LEN ΓòÉΓòÉΓòÉ
  3452.  
  3453. @LEN[string]:  Returns the length of a string. 
  3454.  
  3455.  
  3456. ΓòÉΓòÉΓòÉ 12.44. @LINE ΓòÉΓòÉΓòÉ
  3457.  
  3458. @LINE[filename,n]:  Returns line "n" from the specified file. The first line in 
  3459. the file is numbered 0.  "**EOF**" is returned for all line numbers beyond the 
  3460. end of the file.  If you need to scan through the lines of a file in sequence, 
  3461. the @FILEREAD function (above) and the "@filename" construct available in the 
  3462. FOR command are much faster than calling the @LINE function repeatedly.  @LINE 
  3463. will retrieve input from standard input if you specify CON as the filename.  If 
  3464. you are redirecting input to @LINE using this feature, you must use command 
  3465. grouping or the redirection will not work properly.  For example: 
  3466.  
  3467.         (echo %@line[con,0]) < myfile.dat
  3468.  
  3469.  
  3470. ΓòÉΓòÉΓòÉ 12.45. @LINES ΓòÉΓòÉΓòÉ
  3471.  
  3472. @LINES[filename]:  Returns the line number of the last line in the file, or 
  3473. "-1" if the file is empty.  The first line in the file is numbered 0, so (for 
  3474. example) @LINES will return 0 for a file containing one line. 
  3475.  
  3476.  
  3477. ΓòÉΓòÉΓòÉ 12.46. @LOWER ΓòÉΓòÉΓòÉ
  3478.  
  3479. @LOWER[string]:  Returns the string converted to lower case. 
  3480.  
  3481.  
  3482. ΓòÉΓòÉΓòÉ 12.47. @MAKEAGE ΓòÉΓòÉΓòÉ
  3483.  
  3484. @MAKEAGE[date[,time]]:  Returns the date and time (if included) as a single 
  3485. value in the same format as @FILEAGE. @MAKEAGE can be used to compare the time 
  3486. stamp of a file with a specific date and time, for example: 
  3487.  
  3488.         if %@fileage[myfile] lt %@makeage[1/1/85] echo OLD!
  3489.  
  3490.  
  3491. ΓòÉΓòÉΓòÉ 12.48. @MAKEDATE ΓòÉΓòÉΓòÉ
  3492.  
  3493. @MAKEDATE[n]:  Returns a date (formatted according to the current country 
  3494. settings).  "n" is the number of days since 1/1/80. This is the inverse of 
  3495. @DATE. 
  3496.  
  3497.  
  3498. ΓòÉΓòÉΓòÉ 12.49. @MAKETIME ΓòÉΓòÉΓòÉ
  3499.  
  3500. @MAKETIME[n]:  Returns a time (formatted according to the current country 
  3501. settings).  "n" is the number of seconds since midnight.  This is the inverse 
  3502. of @TIME. 
  3503.  
  3504.  
  3505. ΓòÉΓòÉΓòÉ 12.50. @NAME ΓòÉΓòÉΓòÉ
  3506.  
  3507. @NAME[filename]:  Returns the base name of a file, without the path or 
  3508. extension. 
  3509.  
  3510.  
  3511. ΓòÉΓòÉΓòÉ 12.51. @NUMERIC ΓòÉΓòÉΓòÉ
  3512.  
  3513. @NUMERIC[string]:  Returns "1" if the argument is composed entirely of digits 
  3514. (0 to 9), signs (+ or -), and the thousands and decimal separators.  Otherwise, 
  3515. returns "0". 
  3516.  
  3517.  
  3518. ΓòÉΓòÉΓòÉ 12.52. @PATH ΓòÉΓòÉΓòÉ
  3519.  
  3520. @PATH[filename]:  Returns the path from a file name, including the drive letter 
  3521. and a trailing backslash but not including the base name or extension. 
  3522.  
  3523.  
  3524. ΓòÉΓòÉΓòÉ 12.53. @RANDOM ΓòÉΓòÉΓòÉ
  3525.  
  3526. @RANDOM[min, max]:  Returns a random value between min and max, inclusive. 
  3527. Min, max, and the returned value are all integers. 
  3528.  
  3529.  
  3530. ΓòÉΓòÉΓòÉ 12.54. @READSCR ΓòÉΓòÉΓòÉ
  3531.  
  3532. @READSCR[row,col,length]:  Returns the text displayed on the screen at the 
  3533. specified location.  The upper left corner of the screen is location 0,0.  You 
  3534. can also specify the row and column as offsets from the current cursor 
  3535. position.  Begin the value with a plus sign [+] to read the screen the 
  3536. specified number of rows below (or columns to the right of) the current 
  3537. position, or with a minus sign [-] to read the screen above (or to the left of) 
  3538. the current position. 
  3539.  
  3540.  
  3541. ΓòÉΓòÉΓòÉ 12.55. @READY ΓòÉΓòÉΓòÉ
  3542.  
  3543. @READY[d:]:  Returns "1" if the specified drive is ready; otherwise returns 
  3544. "0". 
  3545.  
  3546.  
  3547. ΓòÉΓòÉΓòÉ 12.56. @REMOTE ΓòÉΓòÉΓòÉ
  3548.  
  3549. @REMOTE[d:]:  Returns "1" if the specified drive is a remote (network) drive; 
  3550. otherwise returns "0". 
  3551.  
  3552.  
  3553. ΓòÉΓòÉΓòÉ 12.57. @REMOVABLE ΓòÉΓòÉΓòÉ
  3554.  
  3555. @REMOVABLE[d:]:  Returns "1" if the specified drive is removable (i.e., a 
  3556. floppy disk or removable hard disk); otherwise returns "0". 
  3557.  
  3558.  
  3559. ΓòÉΓòÉΓòÉ 12.58. @REPEAT ΓòÉΓòÉΓòÉ
  3560.  
  3561. @REPEAT[c,n]:  Returns the character "c" repeated "n" times. 
  3562.  
  3563.  
  3564. ΓòÉΓòÉΓòÉ 12.59. @REXX ΓòÉΓòÉΓòÉ
  3565.  
  3566. @REXX[expr]:  Calls the REXX interpreter to execute the expression. Returns the 
  3567. result string from REXX; if the REXX expression does not return a string, @REXX 
  3568. returns the REXX numeric result code. 
  3569.  
  3570.  
  3571. ΓòÉΓòÉΓòÉ 12.60. @SEARCH ΓòÉΓòÉΓòÉ
  3572.  
  3573. @SEARCH[filename]:  Searches for the filename using the PATH environment 
  3574. variable, appending an extension if one isn't specified.  Returns the 
  3575. fully-expanded name of the file including drive, path, base name, and 
  3576. extension, or an empty string if a matching file is not found.  If wildcards 
  3577. are used in the filename, @SEARCH will search for the first file that matches 
  3578. the wildcard specification, and return the drive and path for that file plus 
  3579. the wildcard filename (e.g., E:\UTIL\*.COM ). 
  3580.  
  3581.  
  3582. ΓòÉΓòÉΓòÉ 12.61. @SELECT ΓòÉΓòÉΓòÉ
  3583.  
  3584. @SELECT[filename,top,left,bottom,right,title]:  Pops up a selection window with 
  3585. the lines from the specified file. Returns the text of the line the scrollbar 
  3586. is on if you press Enter, or an empty string if you press Esc.  @SELECT can be 
  3587. used to display menus or other selection lists from a batch file.  To select 
  3588. from lines passed through input redirection or a pipe, use CON as the filename. 
  3589. You can move through the selection window with standard navigation keystrokes. 
  3590. To change the navigation keys, see the Key Mapping directives in the .INI file. 
  3591.  
  3592.  
  3593. ΓòÉΓòÉΓòÉ 12.62. @SUBSTR ΓòÉΓòÉΓòÉ
  3594.  
  3595. @SUBSTR[string,start,length]:  Returns a substring, starting at the position 
  3596. "start" and continuing for "length" characters.  If the length is omitted, it 
  3597. will default to the remainder of the string.  If the length is negative, the 
  3598. start is relative to the right side of the string.  The first character in the 
  3599. string is numbered 0; if the length is negative, the last character is numbered 
  3600. 0.  For example, %@SUBSTR[%_TIME,0,2] gets the current time and extracts the 
  3601. hour.  If the string includes commas, it must be quoted with double quotes ["] 
  3602. or back quotes [`].  The quotes do count in calculating the position of the 
  3603. substring. @INSTR performs the same function, and allows commas in the string 
  3604. without quoting. 
  3605.  
  3606.  
  3607. ΓòÉΓòÉΓòÉ 12.63. @TIME ΓòÉΓòÉΓòÉ
  3608.  
  3609. @TIME[hh:mm:ss]:  Returns the number of seconds since midnight for the 
  3610. specified time.  The time must be in 24-hour format; "am" and "pm" cannot be 
  3611. used. 
  3612.  
  3613.  
  3614. ΓòÉΓòÉΓòÉ 12.64. @TIMER ΓòÉΓòÉΓòÉ
  3615.  
  3616. @TIMER[n]:  Returns the current split time for a stopwatch started with the 
  3617. TIMER command.  The value of "n" specifies the timer to read and can be 1, 2, 
  3618. or 3. 
  3619.  
  3620.  
  3621. ΓòÉΓòÉΓòÉ 12.65. @TRIM ΓòÉΓòÉΓòÉ
  3622.  
  3623. @TRIM[string]:  Returns the string with the leading and trailing white space 
  3624. (space and tab characters) removed. 
  3625.  
  3626.  
  3627. ΓòÉΓòÉΓòÉ 12.66. @UNIQUE ΓòÉΓòÉΓòÉ
  3628.  
  3629. @UNIQUE[d:\path]:  Creates a zero-length file with a unique name in the 
  3630. specified directory, and returns the full name and path.  If no path is 
  3631. specified, the file will be created in the current directory.  The file name 
  3632. will be FAT-compatible (8 character name and 3-character extension) regardless 
  3633. of whether the file is created on a FAT or HPFS drive.  This function allows 
  3634. you to create a  temporary file without overwriting an existing file. 
  3635.  
  3636.  
  3637. ΓòÉΓòÉΓòÉ 12.67. @UPPER ΓòÉΓòÉΓòÉ
  3638.  
  3639. @UPPER[string]:  Returns the string converted to upper case. 
  3640.  
  3641.  
  3642. ΓòÉΓòÉΓòÉ 12.68. @WORD ΓòÉΓòÉΓòÉ
  3643.  
  3644. @WORD[["xxx",]n,string]:  Returns the "nth" word in a string.  The first word 
  3645. is numbered 0.  If "n" is negative, words are returned from the end of the 
  3646. string.  The first argument is a list of word separators you want to use; if 
  3647. you don't specify it, only spaces, tabs, and commas are considered to be word 
  3648. separators.  For example: 
  3649.  
  3650.         %@WORD[2,NOW IS THE TIME]     returns "THE"
  3651.         %@WORD[-0,NOW IS THE TIME]    returns "TIME"
  3652.         %@WORD[-2,NOW IS THE TIME]    returns "IS"
  3653.         %@WORD["=",1,2 + 2=4]         returns "4"
  3654.  
  3655.  
  3656. ΓòÉΓòÉΓòÉ 12.69. @WORDS ΓòÉΓòÉΓòÉ
  3657.  
  3658. @WORDS[["xxx",]string]:  Returns the number of words in the string.  The 
  3659. optional list of separators follows the same format as @WORD.  If the "string" 
  3660. argument is enclosed in quotation marks, you must enter a list of separators as 
  3661. well. 
  3662.  
  3663.  
  3664. ΓòÉΓòÉΓòÉ 13. 4OS2.INI ΓòÉΓòÉΓòÉ
  3665.  
  3666. The configuration of 4OS2 is controlled through an optional file of 
  3667. initialization information called 4OS2.INI. 
  3668.  
  3669. This section contains general information on 4OS2.INI, and an example. For 
  3670. information on specific directives see the separate topic for each type of 
  3671. directive: 
  3672.  
  3673.             Initialization Directives 
  3674.             Configuration Directives 
  3675.             Color Directives 
  3676.             Key Mapping Directives 
  3677.             Advanced Directives 
  3678.  
  3679.  These topics list the directives, with a one-line description of each, and a 
  3680.  cross-reference which selects a full screen help topic on that directive. A 
  3681.  few of the directives are simple enough that the one-line description is 
  3682.  sufficient, but in most cases you should check for any additional information 
  3683.  in the cross-reference topic if you are not already familiar with the 
  3684.  directive. 
  3685.  
  3686.  You can also obtain help on most directives with a HELP directive command at 
  3687.  the prompt. 
  3688.  
  3689.  You can create, add to, and edit 4OS2.INI with any ASCII text editor.  4OS2 
  3690.  reads 4OS2.INI when it starts, and configures itself accordingly.  4OS2.INI is 
  3691.  not re-read when you change it.  For changes to take effect, you must restart 
  3692.  the session or window in which 4OS2 is running. 
  3693.  
  3694.  Each item that you can include in 4OS2.INI has a default value.  You only need 
  3695.  to include entries in the file for settings that you want to change from their 
  3696.  default values.  If you are happy with all of the default values, you don't 
  3697.  need an .INI file at all. 
  3698.  
  3699.  4OS2 primary shells search for the .INI file in three places: 
  3700.  
  3701.         *   If there is an "@d:\path\inifile" option on the 4OS2 startup 
  3702.             command liine 4OS2 will use the path and file name specified there, 
  3703.             and will not look elsewhere. 
  3704.         *   If there is no .INI file name on the startup command line, the 
  3705.             search proceeds to the same directory where the 4OS2 program file 
  3706.             (4OS2.EXE ) is stored.  This is the "normal" location for the .INI 
  3707.             file.  4OS2 determines this directory automatically.  You can also 
  3708.             set it yourself by placing a COMSPEC directory name on the startup 
  3709.             command line. 
  3710.         *   If the .INI file is not found in the directory where the program 
  3711.             file is stored, a final check is made in the root directory of the 
  3712.             boot drive. 
  3713.  
  3714.  When 4OS2 is loaded as a secondary shell, it does not search for the .INI 
  3715.  file.  Instead, it retrieves the primary shell's .INI file data, processes the 
  3716.  [Secondary] section of the original .INI file if necessary, and then processes 
  3717.  any "@d:\path\inifile" option on the secondary shell command line.  You can 
  3718.  override this behavior with the NextINIFile directive. 
  3719.  
  3720.  Most lines in the .INI file consist of a one-word directive, an equal sign 
  3721.  [=], and a value.  For example, in the following line, the word "History" is 
  3722.  the directive and "2048" is the value: 
  3723.  
  3724.           History = 2048
  3725.  
  3726.  Any spaces before or after the equal sign are ignored. 
  3727.  
  3728.  If you have a long string to enter in the .INI file (for example, for the 
  3729.  ColorDir directive), you must enter it all on one line.  Strings cannot be 
  3730.  "continued" to a second line.  Each line may be up to 1023 characters long. 
  3731.  
  3732.  The format of the value part of a directive line depends on the individual 
  3733.  directive.  It may be a numeric value, a single character, a choice (like 
  3734.  "Yes" or "No"), a color setting, a key name, a path, a filename, or a text 
  3735.  string.  The value begins with the first non-blank character after the equal 
  3736.  sign and ends at the end of the line or the beginning of a comment. 
  3737.  
  3738.  Blank lines are ignored in the .INI file and can be used to separate groups of 
  3739.  directives.  You can place comments in the file by beginning a line with a 
  3740.  semicolon [;].  You can also place comments at the end of any line except one 
  3741.  containing a text string value.  To do so, enter at least one space or tab 
  3742.  after the value, a semicolon, and your comment, like this: 
  3743.  
  3744.           History = 2048       ;set history list size
  3745.  
  3746.  If you try to place a comment at the end of a string value, the comment will 
  3747.  become part of the string and will probably cause an error. 
  3748.  
  3749.  When 4OS2 detects an error while processing the .INI file, it displays an 
  3750.  error message and prompts you to press a key to continue processing the file. 
  3751.  This allows you to note any errors before the startup process continues.  The 
  3752.  directive in error will retain its previous or default value.  Only the most 
  3753.  catastrophic errors (like a disk read failure) will terminate processing of 
  3754.  the remainder of the .INI file.  If you don't want a pause after each error, 
  3755.  use a PauseOnError = No directive at the beginning of the .INI file. 
  3756.  
  3757.  If you need to test different values for an .INI directive without repeatedly 
  3758.  editing the .INI file, see INIQuery. 
  3759.  
  3760.  The .INI file has three sections:  the first or global section, the [Primary] 
  3761.  section, and the [Secondary] section.  The global section consists of 
  3762.  directives at the beginning of the file, with no section name before them. 
  3763.  These directives are effective in all shells.  In most cases, this is the only 
  3764.  section you will need. 
  3765.  
  3766.  The [Primary] and [Secondary] sections include directives that are used in 
  3767.  primary and secondary shells respectively. Each section is identified by the 
  3768.  section name in square brackets on a line by itself.  You don't need to set up 
  3769.  these sections unless you want different directives for primary and secondary 
  3770.  shells. 
  3771.  
  3772.  Directives in the [Primary] section are used for the first or primary shell. 
  3773.  The values are passed automatically to all secondary shells, unless overridden 
  3774.  by a directive with the same name in the [Secondary] section. 
  3775.  
  3776.  Directives in the [Secondary] section are used in secondary shells only, and 
  3777.  override any corresponding primary shell settings. 
  3778.  
  3779.  Sections that begin with any name other than [Primary] or [Secondary] are 
  3780.  ignored. 
  3781.  
  3782.  The SETDOS command can override several of the .INI file directives.  For 
  3783.  example, the cursor shape used by 4OS2 can be adjusted either with the 
  3784.  CursorIns and CursorOver directives or the SETDOS /S command.  The 
  3785.  correspondence between SETDOS options and .INI directives is noted under each 
  3786.  directive below, and under each option of the SETDOS command. 
  3787.  
  3788.  This example configures certain special characters to match 4DOS, and changes 
  3789.  other default settings to suit the user's preferences.  All of these settings 
  3790.  except HelpBook would also work in 4DOS or 4DOS/NT. Note that the comments for 
  3791.  the HelpBook and ColorDir directives are on separate lines before the 
  3792.  directives themselves, as no comments are allowed in string directives: 
  3793.  
  3794.           PauseOnError = No             ;don't stop on INI errors
  3795.           CommandSep = ^                ;4DOS command separator
  3796.           ParameterChar = &             ;4DOS parameter character
  3797.           BatchEcho = No                ;default to ECHO OFF
  3798.                                         ;show only 4OS2 help for F1 / HELP
  3799.           HelpBook = 4OS2
  3800.           History = 2048                ;expand history to 2K bytes
  3801.           BeepFreq = 880                ;make beep higher pitch
  3802.           EditMode = Insert             ;insert mode for cmd edit
  3803.           CursorOver = 100              ;overstrike cursor 100%
  3804.           CursorIns = 10                ;insert cursor 10%
  3805.           ListFind = F5                 ;F5 does a find in LIST
  3806.           ListNext = F6                 ;and F6 does a find next
  3807.           StdColors = bri cya on blu    ;default colors
  3808.           ListColors = bri whi on blu   ;colors for LIST
  3809.           SelectColors = bri whi on blu ;same colors for SELECT
  3810.                                         ;set directory display colors
  3811.           colordir = DIRS:bri yel;com exe bat btm cmd:bri whi
  3812.  
  3813.  
  3814. ΓòÉΓòÉΓòÉ 13.1. Initialization Directives ΓòÉΓòÉΓòÉ
  3815.  
  3816. The directives in this section control how 4OS2 starts and where it looks for 
  3817. its files.  The initialization directives are: 
  3818.  
  3819.         4StartPath          Path for 4START and 4EXIT 
  3820.         DirHistory          Size of directory history list 
  3821.         HelpBook            Books to load in help system 
  3822.         History             Size of history list 
  3823.         INIQuery            Query for each line in 4OS2.INI 
  3824.         LocalAliases        Local vs. global aliases 
  3825.         LocalHistory        Local vs. global directory history 
  3826.         LocalHistory        Local vs. global history 
  3827.         PauseOnError        Pause on errors in 4OS2.INI 
  3828.         WindowState         Initial state for the 4OS2 window 
  3829.         WindowX, WindowY, WindowWidth, WindowHeightInitial size and position of 
  3830.                             the 4OS2 window 
  3831.  
  3832.  
  3833. ΓòÉΓòÉΓòÉ 13.1.1. 4StartPath ΓòÉΓòÉΓòÉ
  3834.  
  3835. 4StartPath = Path:  Sets the drive and directory where the 4START and 4EXIT 
  3836. batch files (if any) are located. 
  3837.  
  3838.  
  3839. ΓòÉΓòÉΓòÉ 13.1.2. DirHistory ΓòÉΓòÉΓòÉ
  3840.  
  3841. DirHistory = nnnn (256):  Sets the amount of memory allocated to the directory 
  3842. history in bytes.  The allowable range of values is 128 to 2048 bytes.  If you 
  3843. use a global directory history list the DirHistory value will be ignored in all 
  3844. shells except the shell which first establishes the global list. 
  3845.  
  3846.  
  3847. ΓòÉΓòÉΓòÉ 13.1.3. HelpBook ΓòÉΓòÉΓòÉ
  3848.  
  3849. HelpBook = String:  Sets the names of the "books" to be loaded when 4OS2 help 
  3850. is invoked with the HELP command or the F1 key.  The default is 4OS2+CMDREF 
  3851. which loads the 4OS2 help and the OS/2 command reference. 
  3852.  
  3853.  
  3854. ΓòÉΓòÉΓòÉ 13.1.4. History ΓòÉΓòÉΓòÉ
  3855.  
  3856. History = nnnn (1024):  Sets the amount of memory allocated to the command 
  3857. history list in bytes.  The allowable range of values is 256 to 32767 bytes. 
  3858. If you use a global history list (see Command History and Recall), the History 
  3859. value is ignored in all shells except the shell which first establishes the 
  3860. global list. 
  3861.  
  3862.  
  3863. ΓòÉΓòÉΓòÉ 13.1.5. INIQuery ΓòÉΓòÉΓòÉ
  3864.  
  3865. INIQuery = Yes | NO:  If set to Yes, a prompt will be displayed before 
  3866. execution of each subsequent line in the current .INI file.  This allows you to 
  3867. modify certain directives when you start 4OS2 in order to test different 
  3868. configurations.  INIQuery can be reset to No at any point in the file. 
  3869. Normally INIQuery = Yes is only used during testing of other .INI file 
  3870. directives. 
  3871.  
  3872. The prompt generated by INIQuery = Yes is: 
  3873.  
  3874.         [contents of the line]  (Y/N/Q/R/E)  ?
  3875.  
  3876. At this prompt, you may enter: 
  3877.  
  3878.         Y = Yes:    Process this line and go on to the next. 
  3879.         N = No:     Skip this line and go on to the next. 
  3880.         Q = Quit:   Skip this line and all subsequent lines. 
  3881.         R = Rest:   Execute this and all subsequent lines. 
  3882.         E = Edit:   Edit the value for this entry. 
  3883.  
  3884.  If you choose E for Edit, you can enter a new value for the directive, but not 
  3885.  a new directive name. 
  3886.  
  3887.  For example, if you have found a compatibility problem you think may be 
  3888.  related to 4OS2's character (as opposed to line) input mode, you might change 
  3889.  your 4OS2.INI file so a part of it read as follows: 
  3890.  
  3891.           INIQuery = Yes
  3892.           LineInput = Yes
  3893.           INIQuery = No
  3894.  
  3895.  You could then choose to process, ignore, or edit the LineInput directive each 
  3896.  time 4OS2 started.  This would allow you to check whether changing the line 
  3897.  input mode would resolve the compatibility problem. 
  3898.  
  3899.  
  3900. ΓòÉΓòÉΓòÉ 13.1.6. LocalAliases ΓòÉΓòÉΓòÉ
  3901.  
  3902. LocalAliases = Yes | NO:  No forces all copies of 4OS2 to share the same alias 
  3903. list.  Yes keeps the lists for each shell separate.  See ALIAS for more details 
  3904. on local and global alias lists. 
  3905.  
  3906.  
  3907. ΓòÉΓòÉΓòÉ 13.1.7. LocalDirHistory ΓòÉΓòÉΓòÉ
  3908.  
  3909. LocalDirHistory = Yes | NO:  No forces all copies of command processor to share 
  3910. the same directory history.  Yes keeps the directory histories for each shell 
  3911. separate.  See Local and Global Directory History for more details. 
  3912.  
  3913.  
  3914. ΓòÉΓòÉΓòÉ 13.1.8. LocalHistory ΓòÉΓòÉΓòÉ
  3915.  
  3916. LocalHistory = Yes | NO:  No forces all copies of 4OS2 to share the same 
  3917. history list.  Yes keeps the lists for each shell separate.  See Command 
  3918. History and Recall for more details on local and global history lists. 
  3919.  
  3920.  
  3921. ΓòÉΓòÉΓòÉ 13.1.9. PauseOnError ΓòÉΓòÉΓòÉ
  3922.  
  3923. PauseOnError = YES | No:  Yes forces a pause with the message "Error in 
  3924. filename, press any key to continue processing" after displaying any error 
  3925. message related to a specific line in the .INI file.  No continues processing 
  3926. with no pause after an error message is displayed. 
  3927.  
  3928.  
  3929. ΓòÉΓòÉΓòÉ 13.1.10. WindowState ΓòÉΓòÉΓòÉ
  3930.  
  3931. WindowState = STANDARD | Maximize | Minimize:  Sets the initial state of the 
  3932. 4OS2 window.  Standard puts the window in the default position on the OS/2 
  3933. desktop, and is the default setting. Maximize maximizes the window; Minimize 
  3934. minimizes it.  If you use Maximize or Minimize, you may see the 4OS2 window 
  3935. appear briefly in the Standard position as it is created by OS/2, then switch 
  3936. to the new state. 
  3937.  
  3938.  
  3939. ΓòÉΓòÉΓòÉ 13.1.11. WindowX, WindowY, WindowWidth, WindowHeight ΓòÉΓòÉΓòÉ
  3940.  
  3941. WindowX = nnnn, WindowY = nnnn, WindowWidth = nnnn, WindowHeight = nnnn:  These 
  3942. 4 directives set the initial size and position of the 4OS2 window.  The 
  3943. measurements are in pixels or pels.  WindowX and WindowY refer to the position 
  3944. of the bottom left corner of the window relative to the bottom left corner of 
  3945. the screen. 
  3946.  
  3947.  
  3948. ΓòÉΓòÉΓòÉ 13.2. Configuration Directives ΓòÉΓòÉΓòÉ
  3949.  
  3950. These directives control the way that 4OS2 operate.  Some can be changed with 
  3951. the SETDOS command while 4OS2 is running. Any corresponding SETDOS command is 
  3952. listed in the description of each directive.  The configuration directives are: 
  3953.  
  3954.         AmPm                Time display format 
  3955.         AppendToDir         "\" on directory names in filename completion 
  3956.         BatchEcho           Default batch file echo state 
  3957.         BeepFreq            Default beep frequency 
  3958.         BeepLength          Default beep length 
  3959.         CommandSep          Multiple command separator character 
  3960.         CursorIns           Cursor shape in insert mode 
  3961.         CursorOver          Cursor shape in overstrike mode 
  3962.         DescriptionMax      Maximum length of file descriptions 
  3963.         DescriptionName     Name of file to hold file descriptions 
  3964.         Descriptions        Enable / disable description processing 
  3965.         EditMode            Editing mode (insert / overstrike) 
  3966.         EscapeChar          4OS2 escape character 
  3967.         EvalMax             Max digits after decimal point in @EVAL 
  3968.         EvalMin             Min digits after decimal point in @EVAL 
  3969.         ExecWait            Wait for external programs at command line 
  3970.         HistCopy            History copy mode 
  3971.         HistLogName         History log file name 
  3972.         HistMin             Minimum command length to save 
  3973.         HistWinColors       History window colors 
  3974.         HistWinHeight       History window height 
  3975.         HistWinLeft         History window left side position 
  3976.         HistWinTop          History window top position 
  3977.         HistWinWidth        History window width 
  3978.         LineInput           Enable / disable line input mode 
  3979.         LogName             Log file name 
  3980.         NoClobber           Overwrite protection for output redirection 
  3981.         ParameterChar       Alias / batch file parameter character 
  3982.         Printer             LIST print device 
  3983.         ScreenRows          Screen height 
  3984.         SwapFilePath        Path to OS/2 swap file 
  3985.         UpperCase           Force file names to upper case 
  3986.  
  3987.  
  3988. ΓòÉΓòÉΓòÉ 13.2.1. AmPm ΓòÉΓòÉΓòÉ
  3989.  
  3990. AmPm = Yes | NO | Auto:  Yes displays times in 12-hour format with a trailing 
  3991. "a" for AM or "p" for PM.  The default of No forces a display in 24-hour time 
  3992. format.  Auto formats the time according to the country code set for your 
  3993. system.  AmPm controls the time displays used by DIR and SELECT, in LOG files, 
  3994. and the output of the TIMER, DATE, and TIME commands.  It has no effect on 
  3995. %_TIME, %@MAKETIME, the $t and $T options of PROMPT, or date and time ranges. 
  3996.  
  3997.  
  3998. ΓòÉΓòÉΓòÉ 13.2.2. AppendToDir ΓòÉΓòÉΓòÉ
  3999.  
  4000. AppendToDir = Yes | NO:  Yes appends a trailing "\" to directory names when 
  4001. doing filename completion.  The default is No. 
  4002.  
  4003.  
  4004. ΓòÉΓòÉΓòÉ 13.2.3. BatchEcho ΓòÉΓòÉΓòÉ
  4005.  
  4006. BatchEcho = YES | No:  Sets the default batch echo mode. Yes enables echoing of 
  4007. all batch file commands unless ECHO is explicitly set off in the batch file. 
  4008. No disables batch file echoing unless ECHO is explicitly set on.  Also see 
  4009. SETDOS /V. 
  4010.  
  4011.  
  4012. ΓòÉΓòÉΓòÉ 13.2.4. BeepFreq ΓòÉΓòÉΓòÉ
  4013.  
  4014. BeepFreq = nnnn (440):  Sets the default BEEP command frequency in Hz.  This is 
  4015. also the frequency for "error" beeps (for example, if you press an illegal 
  4016. key).  To disable all error beeps set this or BeepLength to 0.  If you do, the 
  4017. BEEP command will still be operable, but will not produce sound unless you 
  4018. explicitly specify the frequency and duration. 
  4019.  
  4020.  
  4021. ΓòÉΓòÉΓòÉ 13.2.5. BeepLength ΓòÉΓòÉΓòÉ
  4022.  
  4023. BeepLength = nnnn (2):  Sets the default BEEP length in system clock ticks 
  4024. (approximately 1/18 of a second per tick). BeepLength is also the default 
  4025. length for "error" beeps (for example, if you press an illegal key). 
  4026.  
  4027.  
  4028. ΓòÉΓòÉΓòÉ 13.2.6. CommandSep ΓòÉΓòÉΓòÉ
  4029.  
  4030. CommandSep = c:  This is the character used to separate multiple commands on 
  4031. the same line.  The default is the ampersand [&]. You cannot use any of the 
  4032. redirection characters (| > < ) or any of the whitespace characters (space, 
  4033. tab, comma, or equal sign).  Also see SETDOS /C, the %+ internal variable, and 
  4034. 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using compatible 
  4035. command separators for two or more products. 
  4036.  
  4037.  
  4038. ΓòÉΓòÉΓòÉ 13.2.7. CursorIns ΓòÉΓòÉΓòÉ
  4039.  
  4040. CursorIns = nnnn (100):  This is the shape of the cursor for insert mode during 
  4041. command-line editing and all commands which accept line input (DESCRIBE, ESET, 
  4042. etc.).  The size is a percentage of the total character cell size, between 0% 
  4043. and 100%.  Because of the way video drivers map the cursor shape, you may not 
  4044. get a smooth progression in cursor shapes as CursorIns and CursorOver change. 
  4045. If CursorIns or CursorOver is set to -1, 4OS2 will not attempt to modify the 
  4046. cursor shape at all; you can use this feature to give another program full 
  4047. control of the cursor shape. Also see CursorOver and SETDOS /S. 
  4048.  
  4049.  
  4050. ΓòÉΓòÉΓòÉ 13.2.8. CursorOver ΓòÉΓòÉΓòÉ
  4051.  
  4052. CursorOver = nnnn (15):  This is the shape of the cursor for overtype mode 
  4053. during command-line editing and all commands which accept line input.  The size 
  4054. is a percentage of the total character cell size, between 0% and 100%.  For 
  4055. details see CursorIns; also see SETDOS /S. 
  4056.  
  4057.  
  4058. ΓòÉΓòÉΓòÉ 13.2.9. DescriptionMax ΓòÉΓòÉΓòÉ
  4059.  
  4060. DescriptionMax = nnnn (40):  Controls the description length limit for 
  4061. DESCRIBE.  The allowable range is 20 to 511 characters. 
  4062.  
  4063.  
  4064. ΓòÉΓòÉΓòÉ 13.2.10. DescriptionName ΓòÉΓòÉΓòÉ
  4065.  
  4066. DescriptionName = File:  Sets the file name in which to store file 
  4067. descriptions.  The default file name is DESCRIPT.ION.  Use this directive with 
  4068. caution because changing the name from the default will make it difficult to 
  4069. transfer file descriptions to another system.  Also see SETDOS /D. 
  4070.  
  4071.  
  4072. ΓòÉΓòÉΓòÉ 13.2.11. Descriptions ΓòÉΓòÉΓòÉ
  4073.  
  4074. Descriptions = YES | No:  Turns description handling on or off during the file 
  4075. processing commands COPY, DEL, MOVE, and REN.  If set to No, 4OS2 will not 
  4076. update the description file when files are moved, copied, deleted or renamed. 
  4077. Also see SETDOS /D. 
  4078.  
  4079.  
  4080. ΓòÉΓòÉΓòÉ 13.2.12. EditMode ΓòÉΓòÉΓòÉ
  4081.  
  4082. EditMode = Insert | OVERSTRIKE:  This directive lets you start the command-line 
  4083. editor in either insert or overstrike mode.  Also see SETDOS /M. 
  4084.  
  4085.  
  4086. ΓòÉΓòÉΓòÉ 13.2.13. EscapeChar ΓòÉΓòÉΓòÉ
  4087.  
  4088. EscapeChar = c :  Sets the character used to suppress the normal meaning of the 
  4089. following character.  The default is a caret [^]. See Escape Character for a 
  4090. description of special escape sequences.  You cannot use any of the redirection 
  4091. characters (|, >, or < ) or the whitespace characters (space, tab, comma, or 
  4092. equal sign) as the escape character.  Also see SETDOS /E, the %= internal 
  4093. variable, and 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using 
  4094. compatible escape characters for two or more products. 
  4095.  
  4096.  
  4097. ΓòÉΓòÉΓòÉ 13.2.14. EvalMax ΓòÉΓòÉΓòÉ
  4098.  
  4099. EvalMax = nnnn (8):  Controls the maximum number of digits after the decimal 
  4100. point in values returned by @EVAL. This setting can be overridden with the 
  4101. construct @EVAL[expression=n.n].  The allowable range is 0 to 8.  Also see 
  4102. EvalMin and SETDOS /F. 
  4103.  
  4104.  
  4105. ΓòÉΓòÉΓòÉ 13.2.15. EvalMin ΓòÉΓòÉΓòÉ
  4106.  
  4107. EvalMin = nnnn (8):  Controls the minimum number of digits after the decimal 
  4108. point in values returned by @EVAL.  This setting can be overridden with the 
  4109. construct @EVAL[expression=n.n].  The allowable range is 0 to 8.  The EvalMin 
  4110. value will be ignored if it is larger than EvalMax.  Also see SETDOS /F. 
  4111.  
  4112.  
  4113. ΓòÉΓòÉΓòÉ 13.2.16. ExecWait ΓòÉΓòÉΓòÉ
  4114.  
  4115. ExecWait = Yes | NO:  Controls whether 4OS2 waits for an external program to 
  4116. complete before redisplaying the prompt. This setting applies only to 
  4117. applications started from the 4OS2 prompt. 4OS2 will always wait for 
  4118. applications run from batch files.  ExecWait also has no effect on applications 
  4119. started with the START command, which has its own separate /WAIT switch. 
  4120.  
  4121.  
  4122. ΓòÉΓòÉΓòÉ 13.2.17. HistCopy ΓòÉΓòÉΓòÉ
  4123.  
  4124. HistCopy = Yes | NO:  Controls what happens when you re-execute a line from the 
  4125. command history.  If this option is set to Yes, the line is appended to the end 
  4126. of the history list.  By default, or if this option is set to No, no copy of 
  4127. the command is made.  The original copy of the command is always retained at 
  4128. its original position in the list, regardless of the setting of HistCopy. 
  4129.  
  4130.  
  4131. ΓòÉΓòÉΓòÉ 13.2.18. HistLogName ΓòÉΓòÉΓòÉ
  4132.  
  4133. HistLogName = File:  Sets the history log file name and path.  Using 
  4134. HistLogName does not turn history logging on; you must use a LOG /H ON command 
  4135. to do so. 
  4136.  
  4137.  
  4138. ΓòÉΓòÉΓòÉ 13.2.19. HistMin ΓòÉΓòÉΓòÉ
  4139.  
  4140. HistMin = nnnn (0):  Sets the minimum command-line size to save in the command 
  4141. history list.  Any command line whose length is less than this value will not 
  4142. be saved.  Legal values range from 0, which saves everything, to 1024, which 
  4143. disables all command history saves. 
  4144.  
  4145.  
  4146. ΓòÉΓòÉΓòÉ 13.2.20. HistWinColors ΓòÉΓòÉΓòÉ
  4147.  
  4148. HistWinColors = Color:  Sets the default colors for the command- line and 
  4149. directory history windows.  If this directive is not used the colors will be 
  4150. reversed from the current colors on the screen. 
  4151.  
  4152.  
  4153. ΓòÉΓòÉΓòÉ 13.2.21. HistWinHeight ΓòÉΓòÉΓòÉ
  4154.  
  4155. HistWinHeight = nn (12):  Sets the height of the command-line and directory 
  4156. history windows in lines, including the border.  Legal values range from 5 to 
  4157. the height of your screen.  Any value which would cause the bottom of the 
  4158. window to be off the screen will be adjusted so that the entire window remains 
  4159. on the screen. 
  4160.  
  4161.  
  4162. ΓòÉΓòÉΓòÉ 13.2.22. HistWinLeft ΓòÉΓòÉΓòÉ
  4163.  
  4164. HistWinLeft = nn (40):  Sets the horizontal position of the left side of the 
  4165. command-line and directory history windows.  Legal values range from 0 (the 
  4166. left edge of the screen) to the number of columns on your screen minus 10.  Any 
  4167. value which would cause the right side of a minimum-width window to be off the 
  4168. screen will be adjusted so that the entire window remains on the screen. 
  4169.  
  4170.  
  4171. ΓòÉΓòÉΓòÉ 13.2.23. HistWinTop ΓòÉΓòÉΓòÉ
  4172.  
  4173. HistWinTop = nn (1):  Sets the vertical position of the top of the command-line 
  4174. and directory history windows.  Legal values range from 0 (the top of the 
  4175. screen) to the number of rows on your screen minus 5.  Any value which would 
  4176. cause the bottom of a minimum- height window to be off the screen will be 
  4177. adjusted so that the entire window remains on the screen. 
  4178.  
  4179.  
  4180. ΓòÉΓòÉΓòÉ 13.2.24. HistWinWidth ΓòÉΓòÉΓòÉ
  4181.  
  4182. HistWinWidth = nn (36):  Sets the width of the command-line and directory 
  4183. history windows in characters, including the border. Legal values range from 10 
  4184. to the width of your screen.  Any value which would cause the right side of the 
  4185. window to be off the screen will be adjusted so that the entire window remains 
  4186. on the screen. 
  4187.  
  4188.  
  4189. ΓòÉΓòÉΓòÉ 13.2.25. LineInput ΓòÉΓòÉΓòÉ
  4190.  
  4191. LineInput = Yes | NO:  This directive controls how 4OS2 gets its input from the 
  4192. command line.  Yes forces 4OS2 to perform line-by-line input, just as CMD.EXE 
  4193. does, instead of character-by-character input.  This will disable command-line 
  4194. editing, history recall, the directory history window, and filename completion, 
  4195. and will reduce the 4OS2 input length limit from 1023 characters to 299 
  4196. characters.  It is normally used only for applications which do not work 
  4197. properly unless 4OS2 uses line input.  If you have a particular program that 
  4198. requires line input, you can use SETDOS /L to temporarily change modes.  See 
  4199. README.DOC for information on programs which require this option. 
  4200.  
  4201.  
  4202. ΓòÉΓòÉΓòÉ 13.2.26. LogName ΓòÉΓòÉΓòÉ
  4203.  
  4204. LogName = File:  Sets the log file name and path.  Using LogName does not turn 
  4205. logging on; you must use a LOG ON command to do so. 
  4206.  
  4207.  
  4208. ΓòÉΓòÉΓòÉ 13.2.27. NoClobber ΓòÉΓòÉΓòÉ
  4209.  
  4210. NoClobber = Yes | NO:  If set to Yes, will prevent standard output redirection 
  4211. from overwriting an existing file, and will require that the output file 
  4212. already exist for append redirection.  Also see SETDOS /N. 
  4213.  
  4214.  
  4215. ΓòÉΓòÉΓòÉ 13.2.28. ParameterChar ΓòÉΓòÉΓòÉ
  4216.  
  4217. ParameterChar = c:  Sets the character used after a percent sign to specify all 
  4218. or all remaining command-line arguments in a batch file or alias (e.g., %& or 
  4219. %n&; see Batch Files and ALIAS).  The default is the ampersand [&].  Also see 
  4220. SETDOS /P.  See 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using 
  4221. compatible parameter characters for two or more products.. 
  4222.  
  4223.  
  4224. ΓòÉΓòÉΓòÉ 13.2.29. Printer ΓòÉΓòÉΓòÉ
  4225.  
  4226. Printer = devicename:  Sets the output device that the LIST command will print 
  4227. to.  By default, LPT1 is used. The device can be PRN, LPT1 to 3, COM1 to 4, NUL 
  4228. (which will disable printed output) or any other installed character device. 
  4229.  
  4230.  
  4231. ΓòÉΓòÉΓòÉ 13.2.30. ScreenRows ΓòÉΓòÉΓòÉ
  4232.  
  4233. ScreenRows = nnnn:  Sets the number of screen rows used by the video display. 
  4234. Normally the screen size is determined automatically, but if you have a 
  4235. non-standard display you may need to set it explicitly.  This value does not 
  4236. affect screen scrolling, which is controlled by OS/2 and your video driver. 
  4237. ScreenRows is used only by the LIST and SELECT commands, the paged output 
  4238. options of other commands (e.g., TYPE /P), and error checking in the screen 
  4239. output commands.  Also see SETDOS /R. 
  4240.  
  4241.  
  4242. ΓòÉΓòÉΓòÉ 13.2.31. SwapFilePath ΓòÉΓòÉΓòÉ
  4243.  
  4244. SwapFilePath = Path:  Specifies the path to the OS/2 swap file so the MEMORY 
  4245. command can find it and display its size.  You may specify a fully qualified 
  4246. file name or just the path (the name will default to SWAPPER.DAT).  This 
  4247. directive is only required if the swap file is not stored in the \OS2\SYSTEM 
  4248. directory of the boot drive. 
  4249.  
  4250.  
  4251. ΓòÉΓòÉΓòÉ 13.2.32. UpperCase ΓòÉΓòÉΓòÉ
  4252.  
  4253. UpperCase = Yes | NO:  Yes specifies that file and directory names should be 
  4254. displayed in the traditional upper-case by internal commands like COPY and DIR. 
  4255. No allows the normal 4OS2 lower-case style. This directive does not affect the 
  4256. display of filenames on HPFS drives.  Also see SETDOS /U. 
  4257.  
  4258.  
  4259. ΓòÉΓòÉΓòÉ 13.3. Color Directives ΓòÉΓòÉΓòÉ
  4260.  
  4261. These directives control the colors that 4OS2 use for its displays. Screen 
  4262. border colors can only be set in StdColors.  "BORder" color specifications 
  4263. included in other directives will be ignored.  For complete details on color 
  4264. names see Colors and Color Names.  The color directives are: 
  4265.  
  4266.         BrightBG                Bright background colors 
  4267.         ColorDir                Directory colors 
  4268.         InputColors             Input colors 
  4269.         ListColors              LIST display colors 
  4270.         ListStatBarColors       LIST status bar colors 
  4271.         SelectColors            SELECT display colors 
  4272.         SelectStatBarColors     SELECT status bar colors 
  4273.         StdColors               Standard display colors 
  4274.  
  4275.  
  4276. ΓòÉΓòÉΓòÉ 13.3.1. BrightBG ΓòÉΓòÉΓòÉ
  4277.  
  4278. BrightBG = Yes | No.  If set to Yes, 4OS2 will enable bright background colors 
  4279. in full-screen sessions.  If set to No, bright backgrounds will be disabled but 
  4280. blinking foreground characters will be enabled.  If BrightBG is not used, 4OS2 
  4281. will not adjust the bright background / blinking foreground switch at all. 
  4282. Most color video boards default to a blinking foreground with bright background 
  4283. colors disabled.  See also SETDOS /B. 
  4284.  
  4285. Using BrightBG requires careful attention to interactions of display type, 
  4286. mode, and color.  For a detailed explanation, see Colors and Color Names. 
  4287.  
  4288.  
  4289. ΓòÉΓòÉΓòÉ 13.3.2. ColorDir ΓòÉΓòÉΓòÉ
  4290.  
  4291. ColorDir = ext1 ext2 ...:colora;ext3 ext4 ... :colorb; ...: Sets the directory 
  4292. colors used by DIR and SELECT.  The format is the same as that used for the 
  4293. COLORDIR environment variable.  See Color-Coded Directories for a detailed 
  4294. explanation. 
  4295.  
  4296.  
  4297. ΓòÉΓòÉΓòÉ 13.3.3. InputColors ΓòÉΓòÉΓòÉ
  4298.  
  4299. InputColors = Color:  Sets the colors used for command-line input.  This 
  4300. setting is useful for making your input stand out from the normal output. 
  4301.  
  4302.  
  4303. ΓòÉΓòÉΓòÉ 13.3.4. ListColors ΓòÉΓòÉΓòÉ
  4304.  
  4305. ListColors = Color:  Sets the colors used by the LIST command.  If this 
  4306. directive is not used, LIST will use the current default colors set by the CLS 
  4307. or COLOR command or by the StdColors directive. 
  4308.  
  4309.  
  4310. ΓòÉΓòÉΓòÉ 13.3.5. ListStatBarColors ΓòÉΓòÉΓòÉ
  4311.  
  4312. ListStatBarColors = Color:  Sets the colors used on the LIST status bar.  If 
  4313. this directive is not used, LIST will set the status bar to the reverse of the 
  4314. screen color (the screen color is controlled by ListColors). 
  4315.  
  4316.  
  4317. ΓòÉΓòÉΓòÉ 13.3.6. SelectColors ΓòÉΓòÉΓòÉ
  4318.  
  4319. SelectColors = Color:  Sets the color used by the SELECT command.  If this 
  4320. directive is not used, SELECT will use the current default colors set by the 
  4321. CLS or COLOR command or by the StdColors directive. 
  4322.  
  4323.  
  4324. ΓòÉΓòÉΓòÉ 13.3.7. SelectStatBarColors ΓòÉΓòÉΓòÉ
  4325.  
  4326. SelectStatBarColors = Color:  Sets the color used on the SELECT status bar.  If 
  4327. this directive is not used, SELECT will set the status bar to the reverse of 
  4328. the screen color (the screen color is controlled by SelectColors). 
  4329.  
  4330.  
  4331. ΓòÉΓòÉΓòÉ 13.3.8. StdColors ΓòÉΓòÉΓòÉ
  4332.  
  4333. StdColors = Color:  Sets the standard colors to be used when CLS is used 
  4334. without a color specification, and for LIST and SELECT if ListColors and 
  4335. SelectColors are not used.  Using this directive is similar to placing a COLOR 
  4336. command in AUTOEXEC.BAT.  StdColors takes effect the first time CLS, LIST, or 
  4337. SELECT is used after 4OS2 starts, but will not affect the color of error or 
  4338. other messages displayed during the loading and initialization process. 
  4339.  
  4340.  
  4341. ΓòÉΓòÉΓòÉ 13.4. Key Mapping Directives ΓòÉΓòÉΓòÉ
  4342.  
  4343. These directives allow you to change the keys used for command-line editing and 
  4344. other internal functions.  They are divided into four types, depending on the 
  4345. context in which the keys are used.  For a discussion and list of directives 
  4346. for each type see: 
  4347.  
  4348.             General Input Keys 
  4349.             Command-Line Editing Keys 
  4350.             History and @SELECT Window Keys 
  4351.             LIST Keys 
  4352.  
  4353.  Using a key mapping directive allows you to assign a different or additional 
  4354.  key to perform the function described.  For example, to use function key F3 to 
  4355.  invoke the HELP facility (normally invoked with F1): 
  4356.  
  4357.           Help = F3
  4358.  
  4359.  Any directive can be used multiple times to assign multiple keys to the same 
  4360.  function.  For example: 
  4361.  
  4362.           ListFind = F            ;F does a find in LIST
  4363.           ListFind = F5           ;F5 also does a find in LIST
  4364.  
  4365.  Use some care when you reassign keystrokes.  If you assign a default key to a 
  4366.  different function, it will no longer be available for its original use.  For 
  4367.  example, if you assign F1 to the AddFile directive (a part of filename 
  4368.  completion), the F1 key will no longer invoke the help system, so you will 
  4369.  probably want to assign a different key to Help. 
  4370.  
  4371.  See Keys and Key Names before using the key mapping directives. 
  4372.  
  4373.  Key assignments are processed before looking for keystroke aliases.  For 
  4374.  example, if you assign Shift-F1 to HELP and also assign Shift-F1 to a key 
  4375.  alias, the key alias will be ignored. 
  4376.  
  4377.  Assigning a new keystroke for a function does not deassign the default 
  4378.  keystroke for the same function.  If you want to deassign one of the default 
  4379.  keys, use the NormalKey directive described below or the corresponding 
  4380.  directive for keys in the other key groups (NormalEditKey, NormalHWinKey, or 
  4381.  NormalListKey). 
  4382.  
  4383.  
  4384. ΓòÉΓòÉΓòÉ 13.4.1. General Input Keys ΓòÉΓòÉΓòÉ
  4385.  
  4386. These directives apply to all input.  They are in effect whenever 4OS2 requests 
  4387. input from the keyboard, including during command-line editing and the 
  4388. DESCRIBE, ESET, INPUT, LIST, and SELECT commands.  The general input keys are: 
  4389.  
  4390.         Backspace           Deletes the character to the left of the cursor 
  4391.         BeginLine           Moves the cursor to the start of the line 
  4392.         Del                 Deletes the character at the cursor 
  4393.         DelToBeginning      Deletes from the cursor to the start of the line 
  4394.         DelToEnd            Deletes from the cursor to the end of the line 
  4395.         DelWordLeft         Deletes the word to the left of the cursor 
  4396.         DelWordRight        Deletes the word to the right of the cursor 
  4397.         Down                * Moves the cursor or scrolls the display down 
  4398.         EndLine             Moves the cursor to the end of the line 
  4399.         EraseLine           Deletes the entire line 
  4400.         ExecLine            Executes or accepts a line 
  4401.         Ins                 Toggles insert / overstrike mode 
  4402.         Left                * Moves the cursor or scrolls the display left 
  4403.         NormalKey           * Deassigns a key 
  4404.         Right               * Moves the cursor or scrolls the display right 
  4405.         Up                  * Moves the cursor or scrolls the display up 
  4406.         WordLeft            Moves the cursor left one word 
  4407.         WordRight           Moves the cursor right one word 
  4408.  
  4409.  
  4410. ΓòÉΓòÉΓòÉ 13.4.1.1. Backspace ΓòÉΓòÉΓòÉ
  4411.  
  4412. Backspace = Key (Bksp):  Deletes the character to the left of the cursor. 
  4413.  
  4414.  
  4415. ΓòÉΓòÉΓòÉ 13.4.1.2. BeginLine ΓòÉΓòÉΓòÉ
  4416.  
  4417. BeginLine = Key (Home):  Moves the cursor to the beginning of the line. 
  4418.  
  4419.  
  4420. ΓòÉΓòÉΓòÉ 13.4.1.3. ┬áDel ΓòÉΓòÉΓòÉ
  4421.  
  4422. Del = Key (Del):  Deletes the character at the cursor. 
  4423.  
  4424.  
  4425. ΓòÉΓòÉΓòÉ 13.4.1.4. DelToBeginning ΓòÉΓòÉΓòÉ
  4426.  
  4427. DelToBeginning = Key (Ctrl-Home):  Deletes from the cursor to the start of the 
  4428. line. 
  4429.  
  4430.  
  4431. ΓòÉΓòÉΓòÉ 13.4.1.5. DelToEnd ΓòÉΓòÉΓòÉ
  4432.  
  4433. DelToEnd = Key (Ctrl-End):  Deletes from the cursor to the end of the line. 
  4434.  
  4435.  
  4436. ΓòÉΓòÉΓòÉ 13.4.1.6. DelWordLeft ΓòÉΓòÉΓòÉ
  4437.  
  4438. DelWordLeft = Key (Ctrl-L):  Deletes the word to the left of the cursor. 
  4439.  
  4440.  
  4441. ΓòÉΓòÉΓòÉ 13.4.1.7. DelWordRight ΓòÉΓòÉΓòÉ
  4442.  
  4443. DelWordRight = Key (Ctrl-R, Ctrl-Bksp):  Deletes the word to the right of the 
  4444. cursor.  See ClearKeyMap if you need to remove the default mapping of Ctrl-Bksp 
  4445. to this function. 
  4446.  
  4447.  
  4448. ΓòÉΓòÉΓòÉ 13.4.1.8. Down ΓòÉΓòÉΓòÉ
  4449.  
  4450. Down = Key (Down):  Scrolls the display down one line in LIST; moves the cursor 
  4451. down one line in SELECT and in the command-line history, directory history, or 
  4452. %@SELECT window.  (Scrolling down through the command history at the prompt is 
  4453. controlled by NextHistory, not by this directive.) 
  4454.  
  4455.  
  4456. ΓòÉΓòÉΓòÉ 13.4.1.9. EndLine ΓòÉΓòÉΓòÉ
  4457.  
  4458. EndLine = Key (End):  Moves the cursor to the end of the line. 
  4459.  
  4460.  
  4461. ΓòÉΓòÉΓòÉ 13.4.1.10. EraseLine ΓòÉΓòÉΓòÉ
  4462.  
  4463. EraseLine = Key (Esc):  Deletes the entire line. 
  4464.  
  4465.  
  4466. ΓòÉΓòÉΓòÉ 13.4.1.11. ExecLine ΓòÉΓòÉΓòÉ
  4467.  
  4468. ExecLine = Key (Enter):  Executes or accepts a line. 
  4469.  
  4470.  
  4471. ΓòÉΓòÉΓòÉ 13.4.1.12. Ins ΓòÉΓòÉΓòÉ
  4472.  
  4473. Ins = Key (Ins):  Toggles insert / overstrike mode during line editing. 
  4474.  
  4475.  
  4476. ΓòÉΓòÉΓòÉ 13.4.1.13. Left ΓòÉΓòÉΓòÉ
  4477.  
  4478. Left = Key (Left):  Moves the cursor left one character; scrolls the display 
  4479. left 8 columns in LIST; scrolls the display left 4 columns in the command-line, 
  4480. directory history, or %@SELECT window. 
  4481.  
  4482.  
  4483. ΓòÉΓòÉΓòÉ 13.4.1.14. NormalKey ΓòÉΓòÉΓòÉ
  4484.  
  4485. NormalKey = Key:  Deassigns a general input key in order to disable the usual 
  4486. meaning of the key within 4OS2 and/or make it available for keystroke aliases. 
  4487. This will make the keystroke operate as a "normal" key with no special 
  4488. function.  For example: 
  4489.  
  4490.         NormalKey = Ctrl-End
  4491.  
  4492. will disable Ctrl-End, which is the standard "delete to end of line" key. 
  4493. Ctrl-End could then be assigned to a keystroke alias. Another key could be 
  4494. assigned the "delete to end of line" function with the DelToEnd directive. 
  4495.  
  4496.  
  4497. ΓòÉΓòÉΓòÉ 13.4.1.15. Right ΓòÉΓòÉΓòÉ
  4498.  
  4499. Right = Key (Right):  Moves the cursor right one character; scrolls the display 
  4500. right 8 columns in LIST; scrolls the display right 4 columns in the 
  4501. command-line history, directory history, or %@SELECT window. 
  4502.  
  4503.  
  4504. ΓòÉΓòÉΓòÉ 13.4.1.16. Up ΓòÉΓòÉΓòÉ
  4505.  
  4506. Up = Key (Up):  Scrolls the display up one line in LIST; moves the cursor up 
  4507. one line in SELECT and in the command-line history, directory history, or 
  4508. %@SELECT window.  (Scrolling up through the command history at the prompt is 
  4509. controlled by PrevHistory, not by this directive.) 
  4510.  
  4511.  
  4512. ΓòÉΓòÉΓòÉ 13.4.1.17. WordLeft ΓòÉΓòÉΓòÉ
  4513.  
  4514. WordLeft = Key (Ctrl-Left):  Moves the cursor left one word; scrolls the 
  4515. display left 40 columns in LIST. 
  4516.  
  4517.  
  4518. ΓòÉΓòÉΓòÉ 13.4.1.18. WordRight ΓòÉΓòÉΓòÉ
  4519.  
  4520. WordRight = Key (Ctrl-Right):  Moves the cursor right one word; scrolls the 
  4521. display right 40 columns in LIST. 
  4522.  
  4523.  
  4524. ΓòÉΓòÉΓòÉ 13.4.2. Command-Line Editing Keys ΓòÉΓòÉΓòÉ
  4525.  
  4526. These directives apply only to command-line editing.  They are only effective 
  4527. at the 4OS2 prompt.  The command-line editing keys are: 
  4528.  
  4529.         AddFile             Keeps filename completion entry and adds another 
  4530.         CommandEscape       Allows direct entry of a keystroke 
  4531.         DelHistory          Deletes a history list entry 
  4532.         EndHistory          Displays the last entry in the history list 
  4533.         Help                Invokes this help system 
  4534.         LineToEnd           Copies the current line to the end of the history 
  4535.         NextFile            Gets the next matching filename 
  4536.         NextHistory         Recalls the next command from the history 
  4537.         NormalEditKey       Deassigns a command-line editing key 
  4538.         PopFile             Opens the filename completion window 
  4539.         PrevFile            Gets the previous matching filename 
  4540.         PrevHistory         Recalls the previous command from the history 
  4541.         SaveHistory         Saves the command line without executing it 
  4542.  
  4543.  
  4544. ΓòÉΓòÉΓòÉ 13.4.2.1. AddFile ΓòÉΓòÉΓòÉ
  4545.  
  4546. AddFile = Key (F10):  Keeps the current filename completion entry and inserts 
  4547. the next matching name. 
  4548.  
  4549.  
  4550. ΓòÉΓòÉΓòÉ 13.4.2.2. CommandEscape ΓòÉΓòÉΓòÉ
  4551.  
  4552. CommandEscape = Key (Alt-255):  Allows direct entry of a keystroke that would 
  4553. normally be interpreted as an editor command. 
  4554.  
  4555.  
  4556. ΓòÉΓòÉΓòÉ 13.4.2.3. DelHistory ΓòÉΓòÉΓòÉ
  4557.  
  4558. DelHistory = Key (Ctrl-D):  Deletes the displayed history list entry and 
  4559. displays the previous entry. 
  4560.  
  4561.  
  4562. ΓòÉΓòÉΓòÉ 13.4.2.4. EndHistory ΓòÉΓòÉΓòÉ
  4563.  
  4564. EndHistory = Key (Ctrl-E):  Displays the last entry in the history list. 
  4565.  
  4566.  
  4567. ΓòÉΓòÉΓòÉ 13.4.2.5. ┬áHelp ΓòÉΓòÉΓòÉ
  4568.  
  4569. Help = Key (F1):  Invokes the HELP facility. 
  4570.  
  4571.  
  4572. ΓòÉΓòÉΓòÉ 13.4.2.6. LineToEnd ΓòÉΓòÉΓòÉ
  4573.  
  4574. LineToEnd = Key (Ctrl-Enter):  Copies the current command line to the end of 
  4575. the history list even if it has not been altered. 
  4576.  
  4577.  
  4578. ΓòÉΓòÉΓòÉ 13.4.2.7. NextFile ΓòÉΓòÉΓòÉ
  4579.  
  4580. NextFile = Key (F9, Tab):  Gets the next matching filename. See ClearKeyMap if 
  4581. you need to remove the default mapping of Tab to this function. 
  4582.  
  4583.  
  4584. ΓòÉΓòÉΓòÉ 13.4.2.8. NextHistory ΓòÉΓòÉΓòÉ
  4585.  
  4586. NextHistory = Key (Down):  Recalls the next command from the command history. 
  4587.  
  4588.  
  4589. ΓòÉΓòÉΓòÉ 13.4.2.9. NormalEditKey ΓòÉΓòÉΓòÉ
  4590.  
  4591. NormalEditKey = Key:  Deassigns a command-line editing key in order to disable 
  4592. the usual meaning of the key while editing a command line, and/or make it 
  4593. available for keystroke aliases.  For additional details see NormalKey. 
  4594.  
  4595.  
  4596. ΓòÉΓòÉΓòÉ 13.4.2.10. PopFile ΓòÉΓòÉΓòÉ
  4597.  
  4598. PopFile = Key (F7, Ctrl-Tab):  Opens the filename completion window.  You may 
  4599. not be able to use Ctrl-Tab, because not all systems recognize it as a 
  4600. keystroke.  See ClearKeyMap if you need to remove the default mapping of 
  4601. Ctrl-Tab to this function. 
  4602.  
  4603.  
  4604. ΓòÉΓòÉΓòÉ 13.4.2.11. PrevFile ΓòÉΓòÉΓòÉ
  4605.  
  4606. PrevFile = Key (F8, Shift-Tab):  Gets the previous matching filename.  See 
  4607. ClearKeyMap if you need to remove the default mapping of Shift-Tab to this 
  4608. function. 
  4609.  
  4610.  
  4611. ΓòÉΓòÉΓòÉ 13.4.2.12. PrevHistory ΓòÉΓòÉΓòÉ
  4612.  
  4613. PrevHistory = Key (Up):  Recalls the previous command from the command history. 
  4614.  
  4615.  
  4616. ΓòÉΓòÉΓòÉ 13.4.2.13. SaveHistory ΓòÉΓòÉΓòÉ
  4617.  
  4618. SaveHistory = Key (Ctrl-K):  Saves the command line in the command history list 
  4619. without executing it. 
  4620.  
  4621.  
  4622. ΓòÉΓòÉΓòÉ 13.4.3. History and @SELECT Window Keys ΓòÉΓòÉΓòÉ
  4623.  
  4624. These directives apply only to the command history window, the directory 
  4625. history window, and %@SELECT windows.  The History and @SELECT window keys are: 
  4626.  
  4627.         DirWinOpen          Opens the directory history window 
  4628.         HistWinBegin        Moves to the first line of the history window 
  4629.         HistWinDel          Deletes a line from within the history window 
  4630.         HistWinEdit         Moves a line from the history window to the prompt 
  4631.         HistWinEnd          Moves to the last line of the history window 
  4632.         HistWinExec         Executes the selected line in the history window 
  4633.         HistWinOpen         Opens the command history window 
  4634.         NormalHWinKey       Deassigns a history window key 
  4635.  
  4636.  
  4637. ΓòÉΓòÉΓòÉ 13.4.3.1. DirWinOpen ΓòÉΓòÉΓòÉ
  4638.  
  4639. DirWinOpen = Key (Ctrl-PgUp):  Opens the directory history window while at the 
  4640. command line. 
  4641.  
  4642.  
  4643. ΓòÉΓòÉΓòÉ 13.4.3.2. HistWinBegin ΓòÉΓòÉΓòÉ
  4644.  
  4645. HistWinBegin = Key (Ctrl-PgUp):  Moves to the first line of the history when in 
  4646. the history window. 
  4647.  
  4648.  
  4649. ΓòÉΓòÉΓòÉ 13.4.3.3. HistWinDel ΓòÉΓòÉΓòÉ
  4650.  
  4651. HistWinDel = Key (Ctrl-D):  Deletes a line from within the history window. 
  4652.  
  4653.  
  4654. ΓòÉΓòÉΓòÉ 13.4.3.4. HistWinEdit ΓòÉΓòÉΓòÉ
  4655.  
  4656. HistWinEdit = Key (Ctrl-Enter):  Moves a line from the history window to the 
  4657. prompt for editing. 
  4658.  
  4659.  
  4660. ΓòÉΓòÉΓòÉ 13.4.3.5. HistWinEnd ΓòÉΓòÉΓòÉ
  4661.  
  4662. HistWinEnd = Key (Ctrl-PgDn):  Moves to the last line of the history when in 
  4663. the history window. 
  4664.  
  4665.  
  4666. ΓòÉΓòÉΓòÉ 13.4.3.6. HistWinExec ΓòÉΓòÉΓòÉ
  4667.  
  4668. HistWinExec = Key (Enter):  Executes the selected line in the history window. 
  4669.  
  4670.  
  4671. ΓòÉΓòÉΓòÉ 13.4.3.7. HistWinOpen ΓòÉΓòÉΓòÉ
  4672.  
  4673. HistWinOpen = Key (PgUp):  Brings up the history window while at the command 
  4674. line. 
  4675.  
  4676.  
  4677. ΓòÉΓòÉΓòÉ 13.4.3.8. NormalHWinKey ΓòÉΓòÉΓòÉ
  4678.  
  4679. NormalHWinKey = Key:  Deassigns a history window key in order to disable the 
  4680. usual meaning of the key within the history window. For additional details see 
  4681. NormalKey. 
  4682.  
  4683.  
  4684. ΓòÉΓòÉΓòÉ 13.4.4. LIST Keys ΓòÉΓòÉΓòÉ
  4685.  
  4686. These directives are effective only inside the LIST command.  The LIST keys 
  4687. are: 
  4688.  
  4689.         ListExit            Exits the current file. 
  4690.         ListFind            Prompts and searches for a string 
  4691.         ListHex             Toggles hexadecimal display mode 
  4692.         ListHighBit         Toggles LIST's "strip high bit" option 
  4693.         ListInfo            Displays information about the current file 
  4694.         ListNext            Finds the next matching string 
  4695.         ListPrint           Prints the file on LPT1 
  4696.         ListWrap            Toggles LIST's wrap option 
  4697.         NormalListKey       Deassigns a LIST key 
  4698.  
  4699.  
  4700. ΓòÉΓòÉΓòÉ 13.4.4.1. ListExit ΓòÉΓòÉΓòÉ
  4701.  
  4702. ListExit = Key (Esc):  Exits the current file. 
  4703.  
  4704.  
  4705. ΓòÉΓòÉΓòÉ 13.4.4.2. ListFind ΓòÉΓòÉΓòÉ
  4706.  
  4707. ListFind = Key (F):  Prompts and searches for a string. 
  4708.  
  4709.  
  4710. ΓòÉΓòÉΓòÉ 13.4.4.3. ListHex ΓòÉΓòÉΓòÉ
  4711.  
  4712. ListHex = Key (X):  Toggles hexadecimal display mode. 
  4713.  
  4714.  
  4715. ΓòÉΓòÉΓòÉ 13.4.4.4. ListHighBit ΓòÉΓòÉΓòÉ
  4716.  
  4717. ListHighBit = Key (H):  Toggles LIST's "strip high bit" option, which can aid 
  4718. in displaying files from certain word processors. 
  4719.  
  4720.  
  4721. ΓòÉΓòÉΓòÉ 13.4.4.5. ListInfo ΓòÉΓòÉΓòÉ
  4722.  
  4723. ListInfo = Key (I):  Displays information about the current file. 
  4724.  
  4725.  
  4726. ΓòÉΓòÉΓòÉ 13.4.4.6. ListNext ΓòÉΓòÉΓòÉ
  4727.  
  4728. ListNext = Key (N):  Finds the next matching string. 
  4729.  
  4730.  
  4731. ΓòÉΓòÉΓòÉ 13.4.4.7. ListPrint ΓòÉΓòÉΓòÉ
  4732.  
  4733. ListPrint = Key (P):  Prints the file on LPT1. 
  4734.  
  4735.  
  4736. ΓòÉΓòÉΓòÉ 13.4.4.8. ListWrap ΓòÉΓòÉΓòÉ
  4737.  
  4738. ListWrap = Key (W):  Toggles LIST's wrap option on and off. The wrap option 
  4739. wraps text at the right margin. 
  4740.  
  4741.  
  4742. ΓòÉΓòÉΓòÉ 13.4.4.9. NormalListKey ΓòÉΓòÉΓòÉ
  4743.  
  4744. NormalListKey = Key:  Deassigns a LIST key in order to disable the usual 
  4745. meaning of the key within LIST.  For additional details see NormalKey. 
  4746.  
  4747.  
  4748. ΓòÉΓòÉΓòÉ 13.5. Advanced Directives ΓòÉΓòÉΓòÉ
  4749.  
  4750. These directives are generally used for unusual circumstances, or for 
  4751. diagnosing problems.  Most often they are not needed in normal use.  The 
  4752. advanced directives are: 
  4753.  
  4754.         ClearKeyMap         Clear default key mappings 
  4755.         NextINIFile         Set secondary shell .INI file name 
  4756.  
  4757.  
  4758. ΓòÉΓòÉΓòÉ 13.5.1. ClearKeyMap ΓòÉΓòÉΓòÉ
  4759.  
  4760. ClearKeyMap:  Clears all current key mappings. ClearKeyMap is a special 
  4761. directive which has no value or "=" after it.  Use ClearKeyMap to make one of 
  4762. the keys in the default map (Tab, Shift-Tab, Ctrl-Tab, or Ctrl-Bksp) available 
  4763. for a keystroke alias, or in the [Secondary] section of the .INI file to clear 
  4764. key mappings inherited from the primary shell.  ClearKeyMap should appear 
  4765. before any key mapping directives.  If you want to clear some but not all of 
  4766. the default mappings, use ClearKeyMap, then recreate the mappings you want to 
  4767. retain (e.g., with "NextFile=Tab", etc.). 
  4768.  
  4769.  
  4770. ΓòÉΓòÉΓòÉ 13.5.2. NextINIFile ΓòÉΓòÉΓòÉ
  4771.  
  4772. NextINIFile = File.  The full path and name of the file must be specified.  All 
  4773. subsequent shells will read the specified .INI file, and ignore any [Secondary] 
  4774. section in the original .INI file. 
  4775.  
  4776.  
  4777. ΓòÉΓòÉΓòÉ 14. 4OS2 Commands ΓòÉΓòÉΓòÉ
  4778.  
  4779. The best way to learn the 4OS2 commands is to experiment with them.  The lists 
  4780. below categorize the available commands by topic and will help you find the 
  4781. ones that you need. 
  4782.  
  4783. System configuration: 
  4784.  
  4785.         CHCP          CLS           COLOR         DATE
  4786.         FREE          HISTORY       KEYS          KEYBD
  4787.         LOG           MEMORY        PROMPT        REBOOT
  4788.         SETDOS        TIME          VER           VERIFY
  4789.         VOL
  4790.  
  4791. File and directory management: 
  4792.  
  4793.         ATTRIB        COPY          DEL           DESCRIBE
  4794.         LIST          MOVE          REN           SELECT
  4795.         TYPE
  4796.  
  4797. Subdirectory management: 
  4798.  
  4799.         CD            CDD           DIR           DIRS
  4800.         MD            POPD          PUSHD         RD
  4801.  
  4802. Input and output: 
  4803.  
  4804.         DRAWBOX       DRAWHLINE     DRAWVLINE     ECHO
  4805.         ECHOS         INKEY         INPUT         SCREEN
  4806.         SCRPUT        TEXT          VSCRPUT
  4807.  
  4808. Commands primarily for use in or with batch files and aliases (some work only 
  4809. in batch files; see the individual commands for details): 
  4810.  
  4811.         ALIAS         BEEP          CALL          CANCEL
  4812.         DELAY         DO            ENDLOCAL      FOR
  4813.         GLOBAL        GOSUB         GOTO          IF
  4814.         IFF           LOADBTM       ON            PAUSE
  4815.         QUIT          REM           RETURN        SETLOCAL
  4816.         SHIFT         UNALIAS
  4817.  
  4818. Environment and path commands: 
  4819.  
  4820.         DPATH         ESET          PATH          SET
  4821.         UNSET
  4822.  
  4823. Other commands: 
  4824.  
  4825.         ?             DETACH        EXCEPT        EXIT
  4826.         FFIND         HELP          SHRALIAS      START
  4827.         TEE           TIMER         WINDOW        Y
  4828.  
  4829.  
  4830. ΓòÉΓòÉΓòÉ 14.1. ? - List the internal commands ΓòÉΓòÉΓòÉ
  4831.  
  4832.  Purpose:    Display a list of internal commands or prompt for a command. 
  4833.  
  4834.  Format:     ? ["prompt text" command] 
  4835.  
  4836.  Usage 
  4837.  
  4838.  ? by itself displays a list of internal commands. 
  4839.  
  4840.  If you have disabled a command with SETDOS /I, it will not appear in the list. 
  4841.  
  4842.  If you add prompt text and a command, ? will display the prompt followed by 
  4843.  "(Y/N)?" and wait for the user's response.  If the user presses "Y" or "y", 
  4844.  the command will be executed.  If the user presses "N" or "n", the command 
  4845.  will be ignored. 
  4846.  
  4847.  
  4848. ΓòÉΓòÉΓòÉ 14.2. ALIAS - Create or display aliases ΓòÉΓòÉΓòÉ
  4849.  
  4850.  Purpose:    Create new command names that execute one or more commands or 
  4851.              redefine default options for existing commands; assign commands to 
  4852.              keystrokes; load or display the list of defined alias names. 
  4853.  
  4854.  Format:     ALIAS [/P /R file...] [name [=][value ]] 
  4855.  
  4856.              file :  One or more files to read for alias definitions. 
  4857.              name :  Name for an alias, or for the key to execute the alias. 
  4858.              value :  Text to be substituted for the alias name. 
  4859.  
  4860.              /P(ause)                        /R(ead file) 
  4861.  
  4862.  See also:  UNALIAS. 
  4863.  
  4864.  Usage 
  4865.  
  4866.  The ALIAS command lets you create new command names or redefine internal 
  4867.  commands.  It also lets you assign one or more commands to a single keystroke. 
  4868.  An alias is often used to execute a complex series of commands with a few 
  4869.  keystrokes or to create "in memory batch files" that run much faster than 
  4870.  disk-based batch files. 
  4871.  
  4872.  For example, if you would rather type D instead of DIR /W, you would use the 
  4873.  command: 
  4874.  
  4875.           [c:\] alias d = dir /w
  4876.  
  4877.  Now when you type a single d as a command, it will be translated into a DIR /W 
  4878.  command. 
  4879.  
  4880.  If you define aliases for commonly used application programs, you can often 
  4881.  remove the directories they're stored in from the PATH. For example, if you 
  4882.  use Quattro Pro and had the C:\QPRO directory in your path, you could define 
  4883.  the following alias: 
  4884.  
  4885.           [c:\] alias qpro = c:\qpro\q.exe
  4886.  
  4887.  With this alias defined, you can probably remove C:\QPRO from your path. 
  4888.  Quattro Pro will now load much faster than it would if 4OS2 had to search the 
  4889.  PATH for it.  In addition, the PATH can be shorter, which will speed up 
  4890.  searches for other programs. 
  4891.  
  4892.  If you apply this technique for each application program, you can often reduce 
  4893.  your PATH to just two or three directories containing utility programs, and 
  4894.  significantly reduce the time it takes to load most software on your system. 
  4895.  Before removing a directory from the PATH, you will need to define aliases for 
  4896.  all the executable programs you commonly use which are stored in that 
  4897.  directory. 
  4898.  
  4899.  Aliases are stored in memory, and are not saved automatically when you turn 
  4900.  off your computer or end your current session.  See below for information on 
  4901.  saving and reloading your aliases. 
  4902.  
  4903.  Multiple Commands and Special Characters in Aliases 
  4904.  
  4905.  An alias can represent more than one command.  For example: 
  4906.  
  4907.           [c:\] alias letters = `cd \letters & text`
  4908.  
  4909.  creates a new command called LETTERS.  The command first uses CD to change to 
  4910.  a subdirectory called \LETTERS and then runs a program called TEXT.  The 
  4911.  ampersand [&] is the command separator and indicates that the two commands are 
  4912.  distinct and should be executed sequentially. 
  4913.  
  4914.  Aliases make extensive use of the command separator, and the parameter 
  4915.  character, and may also use the escape character.  These characters differ 
  4916.  between 4DOS and 4OS2 or 4DOS/NT.  In the text and examples below, we use the 
  4917.  4OS2 characters.  If you want to use the same aliases under different command 
  4918.  processors, see 4DOS, 4OS2, and 4DOS/NT Compatibility. 
  4919.  
  4920.  When you type alias commands at the command line or in a batch file, you must 
  4921.  use back quotes [`] around the definition if it contains multiple commands, 
  4922.  parameters (discussed below), environment variables, redirection, or piping. 
  4923.  The back quotes prevent premature expansion of these arguments.  You may use 
  4924.  back quotes around other definitions, but they are not required. (You do not 
  4925.  need back quotes when your aliases are loaded from an ALIAS /R file; see below 
  4926.  for details.)  The examples above and below include back quotes only when they 
  4927.  are required. 
  4928.  
  4929.  Nested Aliases 
  4930.  
  4931.  Aliases may invoke internal commands, external commands, or other aliases. 
  4932.  (However, an alias may not invoke itself, except in special cases where an IF 
  4933.  or IFF command is used to prevent an infinite loop.)  The two aliases below 
  4934.  demonstrate alias nesting (one alias invoking another).  The first line 
  4935.  defines an alias which runs a program called WP.EXE that is in the E:\WP60\ 
  4936.  subdirectory.  The second alias changes directories with the PUSHD command, 
  4937.  runs the WP alias, and then returns to the original directory with the POPD 
  4938.  command: 
  4939.  
  4940.           [c:\] alias wp = e:\wp60\wp.exe
  4941.           [c:\] alias w = `pushd c:\wp & wp & popd`
  4942.  
  4943.  The second alias above could have included the full path and name of the 
  4944.  WP.EXE program instead of calling the WP alias. However, writing two aliases 
  4945.  makes the second one easier to read and understand, and makes the first alias 
  4946.  available for independent use.  If you rename the WP.EXE program or move it to 
  4947.  a new directory, only the first alias needs to be changed. 
  4948.  
  4949.  Temporarily Disabling Aliases 
  4950.  
  4951.  If you put an asterisk [*] immediately before a command in the value of an 
  4952.  alias definition (the part after the equal sign), it tells 4OS2 not to attempt 
  4953.  to interpret that command as another (nested) alias.  An asterisk used this 
  4954.  way must be preceded by a space or the command separator and followed 
  4955.  immediately by an internal or external command name. 
  4956.  
  4957.  By using an asterisk, you can redefine the default options for any internal 
  4958.  command.  For example, suppose that you always want to use the DIR command 
  4959.  with the /2 (two column) and /P (pause at the end of each page) options: 
  4960.  
  4961.           [c:\] alias dir = *dir /2/p
  4962.  
  4963.  If you didn't include the asterisk, the second DIR on the line would be the 
  4964.  name of the alias itself, and 4OS2 would repeatedly re- invoke the DIR alias, 
  4965.  rather than running the DIR command.  This would cause an "Alias loop" or 
  4966.  "Command line too long" error. 
  4967.  
  4968.  An asterisk also helps you keep the names of internal commands from 
  4969.  conflicting with the names of external programs.  For example, suppose you 
  4970.  have a program called LIST.COM.  Normally, the internal LIST command will run 
  4971.  anytime you type LIST.  But two simple aliases will give you access to both 
  4972.  the LIST.COM program and the LIST command: 
  4973.  
  4974.           [c:\] alias list = c:\util\list.com
  4975.           [c:\] alias display = *list
  4976.  
  4977.  The first line above defines LIST as an alias for the LIST.COM program.  If 
  4978.  you stopped there, the external program would run every time you typed LIST 
  4979.  and you would not have easy access to the internal LIST command.  The second 
  4980.  line renames the internal LIST command as DISPLAY.  The asterisk is needed in 
  4981.  the second command to indicate that the following word means the internal 
  4982.  command LIST, not the LIST alias which runs your external program. 
  4983.  
  4984.  You can also use an asterisk before a command that you enter at the command 
  4985.  line or in a batch file.  If you do, that command won't be interpreted as an 
  4986.  alias.  This can be useful when you want to be sure you are running the true, 
  4987.  original command and not an alias with the same name, or temporarily defeat 
  4988.  the purpose of an alias which changes the meaning or behavior of a command. 
  4989.  
  4990.  Partial Alias Names 
  4991.  
  4992.  You can also use an asterisk in the name of an alias.  When you do, the 
  4993.  characters following the asterisk are optional when you invoke the alias 
  4994.  command.  (Use of an asterisk in the alias name is unrelated to the use of an 
  4995.  asterisk in the alias value discussed above.)  For example, with this alias: 
  4996.  
  4997.           [c:\] alias wher*eis = dir /sp
  4998.  
  4999.  the new command, WHEREIS, can be invoked as WHER, WHERE, WHEREI, or WHEREIS. 
  5000.  Now if you type: 
  5001.  
  5002.           [c:\] where myfile.txt
  5003.  
  5004.  The WHEREIS alias will be expanded to the command: 
  5005.  
  5006.           dir /sp myfile.txt
  5007.  
  5008.  Keystroke Aliases 
  5009.  
  5010.  If you want to assign an alias to a keystroke, use the keyname on the left 
  5011.  side of the equal sign, preceded by an at sign [@]. For example, to assign the 
  5012.  command DIR /W to the F5 key, type 
  5013.  
  5014.           [c:\] alias @F5 = dir /w
  5015.  
  5016.  See Keys and Key Names for a complete listing of key names and a description 
  5017.  of the key name format. 
  5018.  
  5019.  When you define keystroke aliases, the assignments will only be in effect at 
  5020.  the command line, not inside application programs.  Be careful not to assign 
  5021.  aliases to keys that are already used at the command line (like F1 for Help). 
  5022.  The command-line meanings take precedence and the keystroke alias will never 
  5023.  be invoked.  If you want to use one of the command-line keys for an alias 
  5024.  instead of its normal meaning, you must first disable its regular use with the 
  5025.  NormalKey or NormalEditKey directive in your .INI file. 
  5026.  
  5027.  If you define a keystroke alias with a single at sign as shown above, then, 
  5028.  when you press the F5 key, the value of the alias (DIR /W above) will be 
  5029.  placed on the command line for you.  You can type additional parameters if you 
  5030.  wish and then press Enter to execute the command.  With this particular alias, 
  5031.  you can define the files that you want to display after pressing F5 and before 
  5032.  pressing Enter to execute the command. 
  5033.  
  5034.  If you want the keystroke alias to take action automatically without waiting 
  5035.  for you to edit the command line or press Enter, you can begin the definition 
  5036.  with two at signs [@@]. 4OS2 will execute the alias "silently," without 
  5037.  displaying its text on the command line.  For example, this command will 
  5038.  assign an alias to the F6 key that uses the CDD command to take you back to 
  5039.  the previous default directory: 
  5040.  
  5041.           [c:\] alias @@f6 = cdd -
  5042.  
  5043.  You can also define a keystroke alias by using "@" or "@@" plus a scan code 
  5044.  for one of the permissible keys (see the Reference Tables for a list of scan 
  5045.  codes).  In most cases it will be easier to use key names.  Scan codes should 
  5046.  only be used with unusual keyboards where a key name is not available for the 
  5047.  key you are using. 
  5048.  
  5049.  Displaying Aliases 
  5050.  
  5051.  If you want to see a list of all current ALIAS commands, type: 
  5052.  
  5053.           [c:\] alias
  5054.  
  5055.  You can also view the definition of a single alias.  If you want to see the 
  5056.  definition of the alias LIST, you can type: 
  5057.  
  5058.           [c:\] alias list
  5059.  
  5060.  Saving and Reloading Your Aliases 
  5061.  
  5062.  You can save your aliases to a file called ALIAS.LST this way: 
  5063.  
  5064.           [c:\] alias > alias.lst
  5065.  
  5066.  You can then reload all the alias definitions in the file the next time you 
  5067.  boot up with the command: 
  5068.  
  5069.           [c:\] alias /r alias.lst
  5070.  
  5071.  This is much faster than defining each alias individually in a batch file.  If 
  5072.  you keep your alias definitions in a separate file which you load when your 
  5073.  system starts, you can edit them with a text editor, reload the edited file 
  5074.  with ALIAS /R, and know that the same alias list will be loaded the next time 
  5075.  you boot your computer. 
  5076.  
  5077.  When you define aliases in a file that will be read with the ALIAS /R command, 
  5078.  you do not need back quotes around the value, even if back quotes would 
  5079.  normally be required when defining the same alias at the command line or in a 
  5080.  batch file. 
  5081.  
  5082.  To remove an alias, use the UNALIAS command. 
  5083.  
  5084.  Alias Parameters 
  5085.  
  5086.  Aliases can use command-line arguments or parameters like those in batch 
  5087.  files.  The command-line arguments are numbered from %0 to %127.  %0 contains 
  5088.  the alias name.  It is up to the alias to determine the meaning of the other 
  5089.  parameters.  You can use quotation marks to pass spaces, tabs, commas, and 
  5090.  other special characters in an alias parameter; see Argument Quoting for 
  5091.  details. 
  5092.  
  5093.  Parameters that are referred to in an alias, but which are missing on the 
  5094.  command line, appear as empty strings inside the alias.  For example, if you 
  5095.  put two parameters on the command line, any reference in the alias to %3 or 
  5096.  any higher-numbered parameter will be interpreted as an empty string. 
  5097.  
  5098.  The parameter %n$ has a special meaning.  4OS2 interprets it to mean "the 
  5099.  entire command line, from argument n to the end."  If n is not specified, it 
  5100.  has a default value of 1, so %$ means "the entire command line after the alias 
  5101.  name."  The special parameter %# contains the number of command-line 
  5102.  arguments. 
  5103.  
  5104.  For example, the following alias will change directories, perform a command, 
  5105.  and return to the original directory: 
  5106.  
  5107.           [c:\] alias in `pushd %1 & %2$ & popd`
  5108.  
  5109.  When this alias is invoked as: 
  5110.  
  5111.           [c:\] in c:\comm mycomm /xmodem /2400
  5112.  
  5113.  the first parameter, %1, has the value c:\comm.  %2 is mycomm,  %3 is /xmodem, 
  5114.  and %4 is /2400. The command line expands into these three separate commands: 
  5115.  
  5116.           pushd c:\comm
  5117.           mycomm /xmodem /2400
  5118.           popd
  5119.  
  5120.  This next example uses the IFF command to redefine the defaults for SET.  It 
  5121.  should be entered on one line: 
  5122.  
  5123.           [c:\] alias set = `iff %# == 0 then & *set /p
  5124.                & else & *set %& & endiff`
  5125.  
  5126.  This modifies the SET command so that if SET is entered with no arguments, it 
  5127.  is replaced by SET /P (pause after displaying each page), but if SET is 
  5128.  followed by an argument, it behaves normally. Note the use of asterisks (*set) 
  5129.  to prevent alias loops. 
  5130.  
  5131.  If an alias uses parameters, command-line arguments will be deleted up to and 
  5132.  including the highest referenced argument.  For example, if an alias refers 
  5133.  only to %1 and %4, then the first and fourth arguments will be used, the 
  5134.  second and third arguments will be discarded, and any additional arguments 
  5135.  beyond the fourth will be appended to the expanded command (after the value 
  5136.  portion of the alias).  If an alias uses no parameters, all of the command- 
  5137.  line arguments will be appended to the expanded command. 
  5138.  
  5139.  Aliases also have full access to all variables in the environment, internal 
  5140.  variables, and variable functions.  For example, you can create a simple 
  5141.  command-line calculator this way (enter this on one line): 
  5142.  
  5143.           [c:\] alias calc = `echo The answer is: %@eval[%&]`
  5144.  
  5145.  Now, if you enter: 
  5146.  
  5147.           [c:\] calc 5 * 6
  5148.  
  5149.  the alias will display: 
  5150.  
  5151.           The answer is: 30
  5152.  
  5153.  Local and Global Aliases 
  5154.  
  5155.  The aliases can be stored in either a "local" or "global" list. 
  5156.  
  5157.  With a local alias list, any changes made to the aliases will only affect the 
  5158.  current copy of 4OS2.  They will not be visible in other shells or other 
  5159.  sessions. 
  5160.  
  5161.  With a global alias list, all copies of 4OS2 will share the same alias list, 
  5162.  and any changes made to the aliases in one copy will affect all other copies. 
  5163.  This is the default. 
  5164.  
  5165.  You can control the type of alias list with the LocalAliases directive in the 
  5166.  .INI file, and with the /L and /LA options of the START command. 
  5167.  
  5168.  Whenever you start a secondary shell which uses a local alias list, it 
  5169.  inherits a copy of the aliases from the previous shell. However, any changes 
  5170.  to the alias made in the secondary shell will affect only that shell.  If you 
  5171.  want changes made in a secondary shell to affect the previous shell, use a 
  5172.  global alias list in both shells. 
  5173.  
  5174.  Retaining Global Aliases with SHRALIAS 
  5175.  
  5176.  If you select a global alias list for 4OS2 you can share the aliases among all 
  5177.  copies of 4OS2 running in any session.  When you close all 4OS2 sessions, the 
  5178.  memory for the global alias list is released, and a new, empty alias list is 
  5179.  created the next time you start 4OS2. 
  5180.  
  5181.  If you want the alias list to be retained in memory even when no command 
  5182.  processor session is running, see the SHRALIAS command, which retains the 
  5183.  global alias, command history, and directory history lists. 
  5184.  
  5185.  SHRALIAS retains the alias list in memory, but cannot preserve it when OS/2 
  5186.  itself is shut down.  To save your aliases when restarting OS/2, you must 
  5187.  store them in a file and reload them after the system restarts.  For details 
  5188.  on how to do so, see Saving and Reloading Your Aliases (above). 
  5189.  
  5190.  The UNKNOWN_CMD Alias 
  5191.  
  5192.  If you create an alias with the name UNKNOWN_CMD, it will be executed any time 
  5193.  4OS2 would normally issue an "Unknown command" error message.  This allows you 
  5194.  to define your own handler for unknown commands.  When the UNKNOWN_CMD alias 
  5195.  is executed, the command line which generated the error is passed to the alias 
  5196.  for possible processing. 
  5197.  
  5198.  Use caution when you create the UNKNOWN_CMD alias.  If it contains an unknown 
  5199.  command, it will be called repeatedly and 4OS2 will lock up in an infinite 
  5200.  loop. 
  5201.  
  5202.  Options 
  5203.  
  5204.     /P:     (Pause) This option is only effective when ALIAS is used to display 
  5205.             existing definitions.  It pauses the display after each page and 
  5206.             waits for a keystroke before continuing (see Page and File 
  5207.             Prompts). 
  5208.  
  5209.     /R:     (Read file) This option loads an alias list from a file. The format 
  5210.             of the file is the same as that of the ALIAS display: 
  5211.  
  5212.                                 name=value
  5213.  
  5214.             where name is the name of the alias and value is its value.  You 
  5215.             can use an equal sign [=] or space to separate the name and value. 
  5216.             Back quotes are not required around the value.  You can add 
  5217.             comments to the file by starting each comment line with a colon 
  5218.             [:].  You can load multiple files with one ALIAS /R command by 
  5219.             placing the names on the command line, separated by spaces: 
  5220.  
  5221.                                 [c:\] alias /r alias1.lst alias2.lst
  5222.  
  5223.             Each definition in an ALIAS /R file can be up to 2047 characters 
  5224.             long. The definitions can span multiple lines in the file if each 
  5225.             line, except the last, is terminated with an escape character. 
  5226.  
  5227.  
  5228. ΓòÉΓòÉΓòÉ 14.3. ATTRIB - Change or view file attributes ΓòÉΓòÉΓòÉ
  5229.  
  5230.  Purpose:    Change or view file and subdirectory attributes. 
  5231.  
  5232.  Format:     ATTRIB [/A:[[-]rhsda] /D /P /Q /S] [+|-[AHRS]] files ... 
  5233.  
  5234.              files :  A file, directory, or list of files or directories on 
  5235.              which to operate. 
  5236.  
  5237.              /A(ttribute select)             /Q(uiet) 
  5238.              /D(irectories)                  /S(ubdirectories) 
  5239.              /P(ause) 
  5240.  
  5241.              Attribute flags: 
  5242.  
  5243.              +A      Set the archive attribute 
  5244.              -A      Clear the archive attribute 
  5245.              +H      Set the hidden attribute 
  5246.              -H      Clear the hidden attribute 
  5247.              +R      Set the read-only attribute 
  5248.              -R      Clear the read-only attribute 
  5249.              +S      Set the system attribute 
  5250.              -S      Clear the system attribute 
  5251.  
  5252.  File Selection 
  5253.  
  5254.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5255.  
  5256.  Usage 
  5257.  
  5258.  Every file and subdirectory has 4 attributes that can be turned on (set) or 
  5259.  turned off (cleared):  Archive, Hidden, Read- only, and System. 
  5260.  
  5261.  The ATTRIB command lets you set or clear attributes for any file, group of 
  5262.  files, or subdirectory.  You can view file attributes by entering ATTRIB 
  5263.  without specifying new attributes (i.e., without the [+|-[AHRS]] part of the 
  5264.  format), or with the DIR /T command. 
  5265.  
  5266.  For example, you can set the read-only and hidden attributes for the file MEMO 
  5267.  : 
  5268.  
  5269.           [c:\] attrib +rh memo
  5270.  
  5271.  Attribute options apply to the file(s) that follow the options on the ATTRIB 
  5272.  command line.  The example below shows how to set different attributes on 
  5273.  different files with a single command.  It sets the archive attribute for all 
  5274.  .TXT files, then sets the system attribute and clears the archive attribute 
  5275.  for TEST.COM : 
  5276.  
  5277.           [c:\] attrib +a *.txt +s -a test.com
  5278.  
  5279.  Your operating system also supports "D" (subdirectory) and "V" (volume label) 
  5280.  attributes.  These attributes cannot be altered with ATTRIB; they are designed 
  5281.  to be controlled only by the operating system itself. 
  5282.  
  5283.  Options 
  5284.  
  5285.     /A:     (Attribute select) Select only those files that have the specified 
  5286.             attribute(s) set.  Preceding the attribute character with a hyphen 
  5287.             [-] will select files that do not have that attribute set.  The 
  5288.             colon [:] after /A is required.  The attributes are: 
  5289.  
  5290.                            R  Read-only 
  5291.                            H  Hidden 
  5292.                            S  System 
  5293.                            D  Subdirectory 
  5294.                            A  Archive 
  5295.  
  5296.             If no attributes are listed at all (e.g., ATTRIB /A: ...), ATTRIB 
  5297.             will select all files and subdirectories including hidden and 
  5298.             system files.  If attributes are combined, all the specified 
  5299.             attributes must match for a file to be selected. For example, 
  5300.             /A:RHS will select only those files with all three attributes set. 
  5301.  
  5302.     /D:     (Directories) If you use the /D option, ATTRIB will modify the 
  5303.             attributes of subdirectories in addition to files (yes, you can 
  5304.             have a hidden subdirectory): 
  5305.  
  5306.                                 [c:\] attrib /d +h c:\mydir
  5307.  
  5308.             In addition, the /D option will keep ATTRIB from appending "\*.*" 
  5309.             to the end of a directory name and modifying the attributes of all 
  5310.             the files in the subdirectory. 
  5311.  
  5312.             If you use a directory name instead of a file name, and omit /D, 
  5313.             ATTRIB will append "\*.*" to the end of the name and act on all 
  5314.             files in that directory, rather than acting on the directory 
  5315.             itself. 
  5316.  
  5317.     /P:     (Pause) Wait for a key to be pressed after each screen page before 
  5318.             continuing the display.  Your options at the prompt are explained 
  5319.             in detail under Page and File Prompts. 
  5320.  
  5321.     /Q:     (Quiet) This option turns off ATTRIB's normal screen output. It is 
  5322.             most useful in batch files. 
  5323.  
  5324.     /S:     (Subdirectories) If you use the /S option, the ATTRIB command will 
  5325.             be applied to all matching files in the current or named directory 
  5326.             and all of its subdirectories. 
  5327.  
  5328.  
  5329. ΓòÉΓòÉΓòÉ 14.4. BEEP - Beep the speaker ΓòÉΓòÉΓòÉ
  5330.  
  5331.  Purpose:    Beep the speaker or play simple music. 
  5332.  
  5333.  Format:     BEEP [frequency duration ...] 
  5334.  
  5335.              frequency :  The beep frequency in Hertz (cycles per second). 
  5336.              duration :  The beep length in 1/18th second intervals. 
  5337.  
  5338.  Usage 
  5339.  
  5340.  BEEP generates a sound through your computer's speaker.  It is normally used 
  5341.  in batch files to signal that an operation has been completed, or that the 
  5342.  computer needs attention. 
  5343.  
  5344.  Because BEEP allows you to specify the frequency and duration of the sound, 
  5345.  you can also use it to play simple music or to create different kinds of 
  5346.  signals for the user. 
  5347.  
  5348.  You can include as many frequency and duration pairs as you wish. No sound 
  5349.  will be generated for frequencies less than 20 Hz, allowing you to insert 
  5350.  short delays.  The default value for frequency is 440 Hz; the default value 
  5351.  for duration is 2. 
  5352.  
  5353.  This batch file fragment runs a program called DEMO, then plays a few notes 
  5354.  and waits for you to press a key: 
  5355.  
  5356.           demo & beep 440 4  600 2  1040 6
  5357.           pause Finished with the demo - hit a key...
  5358.  
  5359.  The following table gives the frequency values for a five octave range (middle 
  5360.  C is 262 Hz): 
  5361.  
  5362.           ΓòöΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòù
  5363.           Γòæ C      Γöé  131  Γöé  262  Γöé  523  Γöé  1046  Γöé  2093 Γòæ
  5364.           Γòæ C#/Db  Γöé  139  Γöé  277  Γöé  554  Γöé  1108  Γöé  2217 Γòæ
  5365.           Γòæ D      Γöé  147  Γöé  294  Γöé  587  Γöé  1175  Γöé  2349 Γòæ
  5366.           Γòæ D#/Eb  Γöé  156  Γöé  311  Γöé  622  Γöé  1244  Γöé  2489 Γòæ
  5367.           Γòæ E      Γöé  165  Γöé  330  Γöé  659  Γöé  1318  Γöé  2637 Γòæ
  5368.           Γòæ F      Γöé  175  Γöé  349  Γöé  698  Γöé  1397  Γöé  2794 Γòæ
  5369.           Γòæ F#/Gb  Γöé  185  Γöé  370  Γöé  740  Γöé  1480  Γöé  2960 Γòæ
  5370.           Γòæ G      Γöé  196  Γöé  392  Γöé  784  Γöé  1568  Γöé  3136 Γòæ
  5371.           Γòæ G#/Ab  Γöé  208  Γöé  415  Γöé  831  Γöé  1662  Γöé  3322 Γòæ
  5372.           Γòæ A      Γöé  220  Γöé  440  Γöé  880  Γöé  1760  Γöé  3520 Γòæ
  5373.           Γòæ A#/Bb  Γöé  233  Γöé  466  Γöé  932  Γöé  1866  Γöé  3729 Γòæ
  5374.           Γòæ B      Γöé  248  Γöé  494  Γöé  988  Γöé  1973  Γöé  3951 Γòæ
  5375.           ΓòÜΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓò¥
  5376.  
  5377.  
  5378. ΓòÉΓòÉΓòÉ 14.5. CALL - Execute one batch file from another ΓòÉΓòÉΓòÉ
  5379.  
  5380.  Purpose:    Execute one batch file from within another. 
  5381.  
  5382.  Format:     CALL file 
  5383.  
  5384.              file :  The batch file to execute. 
  5385.  
  5386.  See also:  CANCEL and QUIT. 
  5387.  
  5388.  Usage 
  5389.  
  5390.  CALL allows batch files to call other batch files (batch file nesting).  The 
  5391.  calling batch file is suspended while the called (second) batch file runs. 
  5392.  When the second batch file finishes, the original batch file resumes execution 
  5393.  at the next command.  If you execute a batch file from inside another batch 
  5394.  file without using CALL, the first batch file is terminated before the second 
  5395.  one starts. 
  5396.  
  5397.  4OS2 supports batch file nesting up to ten levels deep. 
  5398.  
  5399.  The current ECHO state is inherited by a called batch file. 
  5400.  
  5401.  A called batch file will return to the calling file after processing the last 
  5402.  line in the called file, or when a QUIT command is executed.  A called batch 
  5403.  file should always return in this way, or terminate all batch files with 
  5404.  CANCEL.  Restarting (or CALLing) the original batch file from within a called 
  5405.  file will prevent 4OS2 from detecting that you've left the second file, and it 
  5406.  may cause an infinite loop or a stack overflow. 
  5407.  
  5408.  CALL returns an exit code which matches the batch file return code. You can 
  5409.  test this exit code with the %_? or %? environment variable, and use it with 
  5410.  conditional commands(&& and ||). 
  5411.  
  5412.  
  5413. ΓòÉΓòÉΓòÉ 14.6. CANCEL - Terminate batch file processing ΓòÉΓòÉΓòÉ
  5414.  
  5415.  Purpose:    Terminate batch file processing. 
  5416.  
  5417.  Format:     CANCEL [value ] 
  5418.  
  5419.              value :  The exit code from 0 to 255 to return to 4OS2. 
  5420.  
  5421.  See also:  CALL and QUIT. 
  5422.  
  5423.  Usage 
  5424.  
  5425.  The CANCEL command ends all batch file processing, regardless of the batch 
  5426.  file nesting level.  Use QUIT to end a nested batch file and return to the 
  5427.  previous batch file. 
  5428.  
  5429.  You can CANCEL at any point in a batch file.  If CANCEL is used from within an 
  5430.  alias it will end execution of both the alias and any batch file(s) which are 
  5431.  running at the time. 
  5432.  
  5433.  The following batch file fragment compares an input line to "end" and 
  5434.  terminates all batch file processing if it matches: 
  5435.  
  5436.           input Enter your choice:  %%option
  5437.           if "%option" == "end" cancel
  5438.  
  5439.  If you specify a value, CANCEL will set the ERRORLEVEL or exit code to 
  5440.  thatvalue (see the IF command, and the %? variable). 
  5441.  
  5442.  
  5443. ΓòÉΓòÉΓòÉ 14.7. CD - Change the current directory ΓòÉΓòÉΓòÉ
  5444.  
  5445.  Purpose:    Display or change the current directory. 
  5446.  
  5447.  Format:     CD [ path | - ] 
  5448.                 or 
  5449.              CHDIR [ path | - ] 
  5450.  
  5451.              path :  The directory to change to, including an optional drive 
  5452.              name. 
  5453.  
  5454.  See also:  CDD, MD, PUSHD, RD, and CDPATH. 
  5455.  
  5456.  Usage 
  5457.  
  5458.  CD and CHDIR are synonyms.  You can use either one. 
  5459.  
  5460.  CD lets you navigate through the disk subdirectory structure by changing the 
  5461.  current working directory.  If you enter CD and a directory name, the named 
  5462.  directory becomes the new current directory.  For example, to change to the 
  5463.  subdirectory C:\FINANCE\MYFILES : 
  5464.  
  5465.           [c:\] cd \finance\myfiles
  5466.           [c:\finance\myfiles]
  5467.  
  5468.  Every disk drive on the system has its own current directory. Specifying both 
  5469.  a drive and a directory in the CD command will change the current directory on 
  5470.  the specified drive, but will not change the default drive.  For example, to 
  5471.  change the default directory on drive A: 
  5472.  
  5473.           [c:\] cd a:\utility
  5474.           [c:\]
  5475.  
  5476.  Notice that this command does not change to drive A:.  Use the CDD command to 
  5477.  change the current drive and directory at the same time. 
  5478.  
  5479.  You can change to the parent directory with CD ..; you can also go up one 
  5480.  additional directory level with each additional [.]. For example, CD .... will 
  5481.  go up three levels in the directory tree (see Extended Parent Directory 
  5482.  Names).  You can move to a sibling directory -- one that branches from the 
  5483.  same parent directory as the current subdirectory -- with a command like CD 
  5484.  ..\newdir. 
  5485.  
  5486.  If you enter CD with no argument or with only a disk drive name, it will 
  5487.  display the current directory on the default or named drive. 
  5488.  
  5489.  CD saves the current directory before changing to a new directory. You can 
  5490.  switch back to the previous directory by entering CD -. (There must be a space 
  5491.  between the CD command and the hyphen.)  You can switch back and forth between 
  5492.  two directories by repeatedly entering CD -.  The saved directory is the same 
  5493.  for both the CD and CDD commands.  Drive changes and automatic directory 
  5494.  changes also modify the saved directory, so you can use CD - to return to a 
  5495.  directory that you exited with an automatic directory change. 
  5496.  
  5497.  Directory changes made with CD are recorded for display in the directory 
  5498.  history window. 
  5499.  
  5500.  CD never changes the default drive.  If you change directories on one drive, 
  5501.  switch to another drive, and then enter CD -, the directory will be restored 
  5502.  on the first drive but the current drive will not be changed. 
  5503.  
  5504.  If CD can't change directly to the specified directory, it will look for the 
  5505.  CDPATH variable; see CDPATH for details. 
  5506.  
  5507.  
  5508. ΓòÉΓòÉΓòÉ 14.8. CDD - Change the current drive and directory ΓòÉΓòÉΓòÉ
  5509.  
  5510.  Purpose:    Change the current disk drive and directory. 
  5511.  
  5512.  Format:     CDD [ path | - ] 
  5513.  
  5514.              path :  The name of the directory (or drive and directory) to 
  5515.              change to. 
  5516.  
  5517.  See also:  CD, MD, PUSHD, RD, and CDPATH. 
  5518.  
  5519.  Usage 
  5520.  
  5521.  CDD is similar to the CD command, except that it also changes the default disk 
  5522.  drive if one is specified.  CDD will change to the directory and drive you 
  5523.  name.  To change from the root directory on drive A to the subdirectory C:\WP: 
  5524.  
  5525.           [a:\] cdd c:\wp
  5526.           [c:\wp]
  5527.  
  5528.  You can change to the parent directory with CDD ..; you can also go up one 
  5529.  additional directory level with each additional [.].  For example, CDD .... 
  5530.  will go up three levels in the directory tree. 
  5531.  
  5532.  CDD saves the current drive and directory before changing to a new directory. 
  5533.  You can switch back to the previous drive and directory by entering CDD -. 
  5534.  (There must be a space between the CDD command and the hyphen.)  You can 
  5535.  switch back and forth between two drives and directories by repeatedly 
  5536.  entering CDD -.  The saved directory is the same for both the CD and CDD 
  5537.  commands.  Drive changes and automatic directory changes also modify the saved 
  5538.  directory, so you can use CDD - to return to a directory that you exited with 
  5539.  a drive change or an automatic directory change. 
  5540.  
  5541.  Directory changes made with CDD are recorded for display in the directory 
  5542.  history window. 
  5543.  
  5544.  If CDD can't change directly to the specified directory, it will look for the 
  5545.  CDPATH variable; see CDPATH for details. 
  5546.  
  5547.  
  5548. ΓòÉΓòÉΓòÉ 14.9. CHCP - Change the current code page ΓòÉΓòÉΓòÉ
  5549.  
  5550.  Purpose:    Display or change the current system code page. 
  5551.  
  5552.  Format:     CHCP [n ] 
  5553.  
  5554.              n :  A system code page number. 
  5555.  
  5556.  Usage 
  5557.  
  5558.  Code page switching allows you to select different character sets for language 
  5559.  support. 
  5560.  
  5561.  If you enter CHCP without a number, the current code page is displayed. 
  5562.  
  5563.           [c:\] chcp
  5564.           Active code page: 437
  5565.  
  5566.  If you enter CHCP plus a code page number, the system code page is changed. 
  5567.  For example, to set the code page to multilingual: 
  5568.  
  5569.           [c:\] chcp 850
  5570.  
  5571.  CHCP accepts one of the prepared system code pages.  An error message is 
  5572.  displayed if a code page is selected that has not been prepared for the 
  5573.  system. 
  5574.  
  5575.  See your OS/2 documentation for more information on CHCP. 
  5576.  
  5577.  
  5578. ΓòÉΓòÉΓòÉ 14.10. CLS - Clear the screen ΓòÉΓòÉΓòÉ
  5579.  
  5580.  Purpose:    Clear the video display and move the cursor to the upper left 
  5581.              corner; optionally change the default display and border colors. 
  5582.  
  5583.  Format:     CLS [[BRIght] [BLInk] fg ON [BRIght] bg ] [BORder bc ] 
  5584.  
  5585.              fg :  The new foreground color 
  5586.              bg :  The new background color 
  5587.              bc :  The new border color 
  5588.  
  5589.  Usage 
  5590.  
  5591.  CLS can be used to clear the screen without changing colors, or to clear the 
  5592.  screen and change the screen colors simultaneously. These three examples show 
  5593.  how to clear the screen to the default colors, to bright white letters on a 
  5594.  blue background, and to bright yellow letters on a magenta background with a 
  5595.  blue border: 
  5596.  
  5597.           [c:\] cls
  5598.           [c:\] cls bright white on blue
  5599.           [c:\] cls bri yel on mag bor blu
  5600.  
  5601.  CLS is often used in batch files to clear the screen before displaying text. 
  5602.  
  5603.  See Colors and Color Names for details about colors and notes on the use of 
  5604.  bright background colors. 
  5605.  
  5606.  
  5607. ΓòÉΓòÉΓòÉ 14.11. COLOR - Change the display colors ΓòÉΓòÉΓòÉ
  5608.  
  5609.  Purpose:    Change the default display colors. 
  5610.  
  5611.  Format:     COLOR [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc ] 
  5612.  
  5613.              fg :  The new foreground color 
  5614.              bg :  The new background color 
  5615.              bc :  The new border color 
  5616.  
  5617.  See also:  CLS, and Colors and Color Names for details about using colors. 
  5618.  
  5619.  Usage 
  5620.  
  5621.  COLOR is normally used in batch files before displaying text. For example, to 
  5622.  set screen colors to bright white on blue, you can use this command: 
  5623.  
  5624.           [c:\] color bright white on blue
  5625.  
  5626.  
  5627. ΓòÉΓòÉΓòÉ 14.12. COPY - Copy files ΓòÉΓòÉΓòÉ
  5628.  
  5629.  Purpose:    Copy data between disks, directories, files, or physical hardware 
  5630.              devices (such as your printer or serial port). 
  5631.  
  5632.  Format:     COPY [/A:[[-]rhsda] /C /H /M /N /P /Q /R /S /T /U /V] source [+] 
  5633.              ... [/A /B] destination [/A /B] 
  5634.  
  5635.              source :  A file or list of files or a device to copy from. 
  5636.              destination :  A file, directory, or device to copy to. 
  5637.  
  5638.              /A(SCII)                        /P(rompt) 
  5639.              /A:(ttribute select)            /Q(uiet) 
  5640.              /B(inary)                       /R(eplace) 
  5641.              /C(hanged)                      /S(ubdirectories) 
  5642.              /H(idden)                       /T(otals) 
  5643.              /M(odified)                     /U(pdate) 
  5644.              /N(othing)                      /V(erify) 
  5645.  
  5646.  See also:  ATTRIB, MOVE, and REN. 
  5647.  
  5648.  File Selection 
  5649.  
  5650.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5651.  Date, time, or size ranges anywhere on the line apply to all source files. 
  5652.  
  5653.  Usage 
  5654.  
  5655.  The COPY command accepts all traditional syntax and options and adds several 
  5656.  new features. 
  5657.  
  5658.  The simplest use of COPY is to make a copy of a file, like this example which 
  5659.  makes a copy of a file called FILE1.ABC : 
  5660.  
  5661.           [c:\] copy file1.abc file2.def
  5662.  
  5663.  You can also copy a file to another drive and/or directory.  The following 
  5664.  command copies FILE1 to the \MYDIR directory on drive E: 
  5665.  
  5666.           [c:\] copy file1 e:\mydir
  5667.  
  5668.  You can copy several files at once by using wildcards: 
  5669.  
  5670.           [c:\] copy *.txt e:\mydir
  5671.  
  5672.  You can also list several source files in one command.  The following command 
  5673.  copies 3 files from the current directory to the \MYDIR directory on drive E: 
  5674.  
  5675.           [c:\] copy file1 file2 file3 e:\mydir
  5676.  
  5677.  The way COPY interprets your command line depends on how many arguments (file, 
  5678.  directory, or device names) are on the line, and whether the arguments are 
  5679.  separated with [+] signs or spaces. 
  5680.  
  5681.  If there is only one argument on the line, COPY assumes it is the source, and 
  5682.  uses the current drive and directory as the destination.  For example, the 
  5683.  following command copies all the .DAT files on drive A to the current 
  5684.  directory on drive C: 
  5685.  
  5686.           [c:\] copy a:*.dat
  5687.  
  5688.  If there are two or more arguments on the line and [+] signs are not used, 
  5689.  then COPY assumes that the last argument is the destination and copies all 
  5690.  source files to this new location.  If the destination is a drive, directory, 
  5691.  or device name then the source files are copied individually to the new 
  5692.  location.  If the destination is a file name, the first source file is copied 
  5693.  to the destination, and any additional source files are then appended to the 
  5694.  new destination file. 
  5695.  
  5696.  For example, the first of these commands copies the .DAT files from the 
  5697.  current directory on drive A individually to C:\MYDIR (which must already 
  5698.  exist as a directory); the second appends all the .DAT files together into one 
  5699.  large file called C:\DATA (assuming C:\DATA is not a directory): 
  5700.  
  5701.           [c:\] copy a:*.dat c:\mydir\
  5702.           [c:\] copy a:*.dat c:\data
  5703.  
  5704.  When you copy to a directory, if you add a backslash [\] to the end of the 
  5705.  name as shown in the first example above, COPY will display an error message 
  5706.  if the name does not refer to an existing directory.  You can use this feature 
  5707.  to keep COPY from treating a mistyped destination directory name as a file 
  5708.  name and attempting to append all your source files to a destination file, 
  5709.  when you really meant to copy them individually to a destination directory. 
  5710.  
  5711.  A plus [+] tells COPY to append two or more files to a single destination 
  5712.  file.  If you list several source files separated with [+] and don't specify a 
  5713.  destination, COPY will use the name of the first source file as the 
  5714.  destination, and append each subsequent file to the first file.  In this case 
  5715.  the destination file will always be created in the current directory, even if 
  5716.  the first source file is in another directory or on another drive. 
  5717.  
  5718.  For example, the following command will append the contents of C:\MEMO2 and 
  5719.  C:\MEMO3 to C:\MEMO1 and leave the combined contents in the file named 
  5720.  C:\MEMO1 : 
  5721.  
  5722.           [c:\] copy memo1+memo2+memo3
  5723.  
  5724.  To append the same three files but store the result in BIGMEMO: 
  5725.  
  5726.           [c:\] copy memo1+memo2+memo3 bigmemo
  5727.  
  5728.  To append C:\MEM\MEMO2 and C:\MEM\MEMO3 to D:\DATA\MEMO1, and leave the result 
  5729.  in C:\MEM\MEMO1 : 
  5730.  
  5731.           [c:\mem] copy d:\data\memo1+memo2+memo3
  5732.  
  5733.  You cannot append files to a device (such as a printer); if you try to do so, 
  5734.  COPY will ignore the [+] signs and copy the files individually.  If you 
  5735.  attempt to append several source files to a destination directory or disk, 
  5736.  COPY will append the files and place the copy in the new location with the 
  5737.  same name as the first source file. 
  5738.  
  5739.  If your destination has wildcards in it, COPY will attempt to match them with 
  5740.  the source names.  For example, this command copies the .DAT files from drive 
  5741.  A to C:\MYDIR and gives the new copies the extension .DX : 
  5742.  
  5743.           [c:\] copy a:*.dat c:\mydir\*.dx
  5744.  
  5745.  This feature can give you unexpected results if you use it with multiple 
  5746.  source file names.  For example, suppose that drive A contains XYZ.DAT and 
  5747.  XYZ.TXT.  The command 
  5748.  
  5749.           [c:\] copy a:\*.dat a:\*.txt c:\mydir\*.dx
  5750.  
  5751.  will copy A:XYZ.DAT to C:\MYDIR\XYZ.DX.  Then it will copy A:XYZ.TXT to 
  5752.  C:\MYDIR\XYZ.DX, overwriting the first file it copied. 
  5753.  
  5754.  COPY also understands include lists, so you can specify several different 
  5755.  kinds of files in the same command.  This command copies the .TXT, .DOC, and 
  5756.  .BAT files from the E:\MYDIR directory to the root directory of drive A: 
  5757.  
  5758.           [c:\] copy e:\mydir\*.txt;*.doc;*.bat a:\
  5759.  
  5760.  You can use date, time, and size ranges to further define the files that you 
  5761.  want to copy.  This example copies every file in the E:\MYDIR directory, which 
  5762.  was created or modified yesterday, and which is also 10,000 bytes or smaller 
  5763.  in size, to the root directory of drive A: 
  5764.  
  5765.           [c:\] copy /[d-1] /[s0,10000] e:\mydir\*.* a:\
  5766.  
  5767.  COPY maintains the hidden and system attributes of files, but not the 
  5768.  read-only attribute.  The destination file will always have the archive 
  5769.  attribute set. 
  5770.  
  5771.  Options 
  5772.  
  5773.  The /A(SCII) and /B(inary) options apply to the preceding filename and to all 
  5774.  subsequent filenames on the command line until the file name preceding the 
  5775.  next /A or /B, if any.  The other options (/A:, /C, /H, /M, /N, /P, /Q, /R, 
  5776.  /S, /T, /U, /V) apply to all filenames on the command line, no matter where 
  5777.  you put them.  For example, either of the following commands could be used to 
  5778.  copy a font file to the printer in binary mode: 
  5779.  
  5780.           [c:\] copy /b myfont.dat prn
  5781.           [c:\] copy myfont.dat /b prn
  5782.  
  5783.  Some options do not make sense in certain contexts, in which case COPY will 
  5784.  ignore them.  For example, you cannot prompt before replacing an existing file 
  5785.  when the destination is a device such as the printer -- there's no such thing 
  5786.  as an "existing file" on the printer.  If you use conflicting output options, 
  5787.  like /Q and /P, COPY will take a "conservative" approach and give priority to 
  5788.  the option which generates more prompts or more information. 
  5789.  
  5790.     /A:     (ASCII) If you use /A with a source filename, the file will be 
  5791.             copied up to, but not including, the first Ctrl-Z (Control-Z or 
  5792.             ASCII 26) character in the file.  If you use /A with a destination 
  5793.             filename, a Ctrl-Z will be added to the end of the file (some 
  5794.             application programs use the Ctrl-Z to mark the end of a file).  /A 
  5795.             is the default when appending files, or when the destination is a 
  5796.             device like NUL or PRN, rather than a disk file. 
  5797.  
  5798.     /A:     (Attribute select) Select only those files that have the specified 
  5799.             attribute(s) set.  Preceding the attribute character with a hyphen 
  5800.             [-] will select files that do not have that attribute set.  The 
  5801.             colon [:] after /A is required.  The attributes are: 
  5802.  
  5803.                            R  Read-only 
  5804.                            H  Hidden 
  5805.                            S  System 
  5806.                            D  Subdirectory 
  5807.                            A  Archive 
  5808.  
  5809.             If no attributes are listed at all (e.g., COPY /A: ...), COPY will 
  5810.             select all files and subdirectories including hidden and system 
  5811.             files.  If attributes are combined, all the specified attributes 
  5812.             must match for a file to be selected. For example, /A:RHS will 
  5813.             select only those files with all three attributes set.  You must 
  5814.             include the colon with this option to distinguish it from the 
  5815.             /A(SCII) switch, above. 
  5816.  
  5817.     /B:     (Binary) If you use /B with a source filename, the entire file is 
  5818.             copied; Ctrl-Z characters in the file do not affect the copy 
  5819.             operation.  Using /B with a destination filename prevents addition 
  5820.             of a Ctrl-Z to the end of the destination file. /B is the default 
  5821.             for normal file copies. 
  5822.  
  5823.     /C:     (Changed files) Copy files only if the destination file exists and 
  5824.             is older than the source (see also /U).  This option is useful for 
  5825.             updating the files in one directory from those in another without 
  5826.             copying any newly created files. 
  5827.  
  5828.     /H:     (Hidden) Copy all matching files including those with the hidden 
  5829.             and/or system attribute set. 
  5830.  
  5831.     /M:     (Modified) Copy only those files with the archive attribute set, 
  5832.             i.e., those which have been modified since the last backup.  The 
  5833.             archive attribute will not be cleared after copying; to clear it 
  5834.             use ATTRIB. 
  5835.  
  5836.     /N:     (Nothing) Do everything except actually perform the copy. This 
  5837.             option is useful for testing what the result of a complex COPY 
  5838.             command will be. 
  5839.  
  5840.     /P:     (Prompt) Ask the user to confirm each source file.  Your options at 
  5841.             the prompt are explained in detail under Page and File Prompts. 
  5842.  
  5843.     /Q:     (Quiet) Don't display filenames or the total number of files 
  5844.             copied.  This option is most often used in batch files.  See also 
  5845.             /T. 
  5846.  
  5847.     /R:     (Replace) Prompt the user before overwriting an existing file. 
  5848.             Your options at the prompt are explained in detail under Page and 
  5849.             File Prompts. 
  5850.  
  5851.     /S:     (Subdirectories) Copy the subdirectory tree starting with the files 
  5852.             in the source directory plus each subdirectory below that.  The 
  5853.             destination must be a directory; if it doesn't exist, COPY will 
  5854.             attempt to create it.  COPY will also attempt to create needed 
  5855.             subdirectories on the tree below the destination, including empty 
  5856.             source directories.  If you attempt to use COPY /S to copy a 
  5857.             subdirectory tree into part of itself, COPY will display an error 
  5858.             message and exit. 
  5859.  
  5860.     /T:     (Totals) Turns off  the display of filenames, like /Q, but does 
  5861.             display the total number of files copied. 
  5862.  
  5863.     /U:     (Update) Copy each source file only if it is newer than a matching 
  5864.             destination file or if a matching destination file does not exist 
  5865.             (see also /C).  This option is useful for keeping one directory 
  5866.             matched with another with a minimum of copying. 
  5867.  
  5868.     /V:     (Verify) Verify each disk write.  This is the same as executing the 
  5869.             VERIFY ON command, but is only active during the COPY.  /V does not 
  5870.             read back the file and compare its contents with what was written; 
  5871.             it only verifies that the data written to disk is physically 
  5872.             readable. 
  5873.  
  5874.  
  5875. ΓòÉΓòÉΓòÉ 14.13. DATE - Change the system date ΓòÉΓòÉΓòÉ
  5876.  
  5877.  Purpose:    Display and optionally change the system date. 
  5878.  
  5879.  Format:     DATE [mm -dd -yy ] 
  5880.  
  5881.              mm :  The month (1 - 12). 
  5882.              dd :  The day (1 - 31). 
  5883.              yy :  The year (80 - 99 = 1980 - 1999, or a 4- digit year). 
  5884.  
  5885.  See also:  TIME. 
  5886.  
  5887.  Usage 
  5888.  
  5889.  If you simply type DATE without any parameters, you will see the current 
  5890.  system date and time, and be prompted for a new date. Press ENTER if you don't 
  5891.  wish to change the date.  If you type a new date, it will become the current 
  5892.  system date, which is included in the directory entry for each file as it is 
  5893.  created or altered: 
  5894.  
  5895.           [c:\] date
  5896.           Thu  Dec 22, 1994  9:30:06
  5897.           Enter new date (mm-dd-yy):
  5898.  
  5899.  You can also enter a new system date by typing the DATE command plus the new 
  5900.  date on the command line: 
  5901.  
  5902.           [c:\] date 3-16-95
  5903.  
  5904.  You can use hyphens, slashes, or periods to separate the month, day, and year 
  5905.  entries.  A full 4-digit year can be entered if you wish. 
  5906.  
  5907.  DATE adjusts the format it expects depending on your country settings.  When 
  5908.  entering the date, use the correct format for the country setting currently in 
  5909.  effect on your system. 
  5910.  
  5911.  
  5912. ΓòÉΓòÉΓòÉ 14.14. DEL - Delete one or more files ΓòÉΓòÉΓòÉ
  5913.  
  5914.  Purpose:    Erase one file, a group of files, or entire subdirectories. 
  5915.  
  5916.  Format:     DEL [/A:[[-]rhsda] /F /N /P /Q /S /T /X /Y /Z] file... 
  5917.                 or 
  5918.              ERASE [/A:[[-]rhsda] /F /N /P /Q /S /T /X /Y /Z] file... 
  5919.  
  5920.              file :  The file, subdirectory, or list of files or subdirectories 
  5921.              to erase. 
  5922.  
  5923.              /A:(ttribute select)            /S(ubdirectories) 
  5924.              /F(orce delete)                 /T(otal) 
  5925.              /N(othing)                      /X (remove empty subdirectories) 
  5926.              /P(rompt)                       /Y(es to all prompts) 
  5927.              /Q(uiet)                        /Z(ap hidden and read-only files) 
  5928.  
  5929.  File Selection 
  5930.  
  5931.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5932.  
  5933.  Usage 
  5934.  
  5935.  DEL and ERASE are synonyms, you can use either one. 
  5936.  
  5937.  Use the DEL and ERASE commands with caution; the files and subdirectories that 
  5938.  you erase may be impossible to recover without specialized utilities and a lot 
  5939.  of work. 
  5940.  
  5941.  To erase a single file, simply enter the file name: 
  5942.  
  5943.           [c:\] del letters.txt
  5944.  
  5945.  You can also erase multiple files in a single command.  For example, to erase 
  5946.  all the files in the current directory with a .BAK or .PRN extension: 
  5947.  
  5948.           [c:\] del *.bak *.prn
  5949.  
  5950.  If you enter a subdirectory name, or a filename composed only of wildcards (* 
  5951.  and/or ?), DEL asks for confirmation (Y or N) unless you specified the /Y 
  5952.  option.  If you respond with a Y, DEL will delete all the files in that 
  5953.  subdirectory (hidden, system, and read-only files are only deleted if you use 
  5954.  the /Z option). 
  5955.  
  5956.  DEL displays the amount of disk space recovered, unless the /Q option is used 
  5957.  (see below).  It does so by comparing the amount of free disk space before and 
  5958.  after the DEL command is executed.  This amount may be incorrect if you are 
  5959.  using a deletion tracking system which stores deleted files in a hidden 
  5960.  directory, or if, under a multitasking system, another program performs a file 
  5961.  operation while the DEL command is executing. 
  5962.  
  5963.  Remember that DEL removes file descriptions along with files.  Most deletion 
  5964.  tracking systems will not be able to save or recover a file's description, 
  5965.  even if they can save or recover the data in a file. 
  5966.  
  5967.  DEL returns a non-zero exit code if no files are deleted, or if another error 
  5968.  occurs.  You can test this exit code with the %_? environment variable, and 
  5969.  use it with conditional commands)(&& and ||). 
  5970.  
  5971.  Options 
  5972.  
  5973.     /A:     (Attribute select) Select only those files that have the specified 
  5974.             attribute(s) set.  Preceding the attribute character with a hyphen 
  5975.             [-] will select files that do not have that attribute set.  The 
  5976.             colon [:] after /A is required.  The attributes are: 
  5977.  
  5978.                            R  Read-only 
  5979.                            H  Hidden 
  5980.                            S  System 
  5981.                            D  Subdirectory 
  5982.                            A  Archive 
  5983.  
  5984.             If no attributes are listed at all (e.g., DEL /A: ...), DEL will 
  5985.             select all files and subdirectories including hidden and system 
  5986.             files.  If attributes are combined, all the specified attributes 
  5987.             must match for a file to be selected. For example, /A:RHS will 
  5988.             select only those files with all three attributes set. 
  5989.  
  5990.     /F:     (Force delete) This option is only available in the 32-bit version 
  5991.             of 4OS2.  It forces deletion of the file without saving it to the 
  5992.             DELDIR directory (if DELDIR is not in use, /F has no effect). 
  5993.  
  5994.     /N:     (Nothing) Do everything except actually delete the file(s).  This 
  5995.             is useful for testing what the result of a DEL would be. 
  5996.  
  5997.     /P:     (Prompt) Prompt the user to confirm each erasure.  Your options at 
  5998.             the prompt are explained in detail under Page and File Prompts. 
  5999.  
  6000.     /Q:     (Quiet) Don't display filenames as they are deleted, or the number 
  6001.             of files deleted or bytes freed.  See also /T. 
  6002.  
  6003.     /S:     (Subdirectories) Delete the specified files in this directory and 
  6004.             all of its subdirectories.  This is like a GLOBAL DEL, and can be 
  6005.             used to delete all the files in a subdirectory tree or even a whole 
  6006.             disk.  It should be used with caution! 
  6007.  
  6008.     /T:     (Total) Don't display filenames as they are deleted, but display 
  6009.             the total number of files deleted plus the amount of free disk 
  6010.             space recovered.  Unlike /Q, the /T option will not speed up 
  6011.             deletions under DOS. 
  6012.  
  6013.     /X:     (Remove empty subdirectories) Remove empty subdirectories after 
  6014.             deleting (only useful when used with /S). 
  6015.  
  6016.     /Y:     (Yes) The reverse of /P -- it assumes a Y response to everything, 
  6017.             including deleting an entire subdirectory tree.  4OS2 normally 
  6018.             prompts before deleting files when the name consists only of 
  6019.             wildcards or a subdirectory name (see above); /Y overrides this 
  6020.             protection, and should be used with extreme caution! 
  6021.  
  6022.     /Z:     (Zap) Delete read-only, hidden, and system files as well as normal 
  6023.             files.  Files with the read-only, hidden, or system attribute set 
  6024.             are normally protected from deletion; /Z overrides this protection, 
  6025.             and should be used with caution.  Because EXCEPT works by hiding 
  6026.             files, /Z will override an EXCEPT command. 
  6027.  
  6028.             For example, to delete the entire subdirectory tree starting with 
  6029.             C:\UTIL, including hidden and read- only files, without prompting 
  6030.             (use this command with CAUTION!): 
  6031.  
  6032.                                 [c:\] del /sxyz c:\util\
  6033.  
  6034.  
  6035. ΓòÉΓòÉΓòÉ 14.15. DELAY - Pause for a specified length of time ΓòÉΓòÉΓòÉ
  6036.  
  6037.  Purpose:    Pause for a specified length of time. 
  6038.  
  6039.  Format:     DELAY [seconds ] 
  6040.  
  6041.              seconds :  The number of seconds to delay. 
  6042.  
  6043.  Usage 
  6044.  
  6045.  DELAY is useful in batch file loops while waiting for something to occur.  To 
  6046.  wait for 10 seconds: 
  6047.  
  6048.           delay 10
  6049.  
  6050.  A simple loop could make a tone with the BEEP command to get the operator's 
  6051.  attention and then DELAY for a few seconds while waiting for the user to 
  6052.  respond. 
  6053.  
  6054.  For delays shorter than one second, use the BEEP command with an inaudible 
  6055.  frequency (below 20 Hz). 
  6056.  
  6057.  You can cancel a delay by pressing Ctrl-C or Ctrl-Break. 
  6058.  
  6059.  
  6060. ΓòÉΓòÉΓòÉ 14.16. DESCRIBE - Create or modify file descriptions ΓòÉΓòÉΓòÉ
  6061.  
  6062.  Purpose:    Create, modify, or delete file and subdirectory descriptions. 
  6063.  
  6064.  Format:     DESCRIBE [/A:[[-]rhsda]] file ["description" ] ... 
  6065.  
  6066.  /A:(ttribute select) 
  6067.  
  6068.              file :  The file or files to operate on. 
  6069.              "description" :  The description to attach to the file. 
  6070.  
  6071.  File Selection 
  6072.  
  6073.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  6074.  
  6075.  Usage 
  6076.  
  6077.  DESCRIBE adds descriptions to files and subdirectories.  The descriptions are 
  6078.  displayed by DIR in single-column mode and by SELECT.  Descriptions let you 
  6079.  identify your files in much more meaningful ways than you can in an 
  6080.  eight-character filename. 
  6081.  
  6082.  You enter a description on the command line by typing the DESCRIBE command, 
  6083.  the filename, and the description in quotation marks, like this: 
  6084.  
  6085.           [c:\] describe memo.txt "Memo to Bob about party"
  6086.  
  6087.  If you don't put a description on the command line, DESCRIBE will prompt you 
  6088.  for it: 
  6089.  
  6090.           [c:\] describe memo.txt
  6091.           Describe "memo.txt" : Memo to Bob about party
  6092.  
  6093.  If you use wildcards or multiple filenames with the DESCRIBE command and don't 
  6094.  include the description text, you will be prompted to enter a description for 
  6095.  each file.  If you do include the description on the command line, all 
  6096.  matching files will be given the same description. 
  6097.  
  6098.  Each description can be up to 40 characters long.  You can change this limit 
  6099.  with the DescriptionMax directive in 4OS2.INI.  DESCRIBE can edit descriptions 
  6100.  longer than DescriptionMax (up to a limit of 511 characters), but will not 
  6101.  allow you to lengthen the existing text. 
  6102.  
  6103.  The descriptions are stored in each directory in a hidden file called 
  6104.  DESCRIPT.ION.  Use the ATTRIB command to remove the hidden attribute from this 
  6105.  file if you need to copy or delete it.  DESCRIPT.ION is always created as a 
  6106.  hidden file, but will not be re-hidden by 4OS2 if you remove the hidden 
  6107.  attribute.  You can change the description file name with the DescriptionName 
  6108.  directive in 4OS2.INI or the SETDOS /D command, and retrieve it with the 
  6109.  _DName internal variable. 
  6110.  
  6111.  The description file is modified appropriately whenever you perform an 
  6112.  internal command which affects it (such as COPY, MOVE, DEL, or RENAME), but 
  6113.  not if you use an external program (such as XCOPY or a visual shell). 
  6114.  
  6115.  On HPFS drives, you will not see file descriptions in a normal DIR display, 
  6116.  because DIR must leave space for the long filenames used on these drives.  To 
  6117.  view the descriptions, use DIR /Z to display the directory in FAT format.  See 
  6118.  the DIR command for more details. 
  6119.  
  6120.  Options 
  6121.  
  6122.     /A:     (Attribute select) Select only those files that have the specified 
  6123.             attribute(s) set.  Preceding the attribute character with a hyphen 
  6124.             [-] will select files that do not have that attribute set.  The 
  6125.             colon [:] after /A is required.  The attributes are: 
  6126.  
  6127.                            R  Read-only 
  6128.                            H  Hidden 
  6129.                            S  System 
  6130.                            D  Subdirectory 
  6131.                            A  Archive 
  6132.  
  6133.             If no attributes are listed at all (e.g., DESCRIBE /A: ...), 
  6134.             DESCRIBE will select all files and subdirectories including hidden 
  6135.             and system files.  If attributes are combined, all the specified 
  6136.             attributes must match for a file to be selected. For example, 
  6137.             /A:RHS will select only those files with all three attributes set. 
  6138.  
  6139.  
  6140. ΓòÉΓòÉΓòÉ 14.17. DETACH - Start a program in detached mode ΓòÉΓòÉΓòÉ
  6141.  
  6142.  Purpose:    Start an OS/2 program in detached mode. 
  6143.  
  6144.  Format:     DETACH command 
  6145.  
  6146.              command :  The name of a command to execute, including an optional 
  6147.              drive and path specification. 
  6148.  
  6149.  See also:  START. 
  6150.  
  6151.  Usage 
  6152.  
  6153.  When you start a program with DETACH, that program cannot use the keyboard, 
  6154.  mouse, or video display.  It is "detached" from the normal means of user input 
  6155.  and output.  However, you can redirect the program's standard I/O to other 
  6156.  devices if necessary, using redirection symbols. 
  6157.  
  6158.  The command can be an internal command, external command, alias, or batch 
  6159.  file.  If it is not an external command, 4OS2 will detach a copy of itself to 
  6160.  execute the command. 
  6161.  
  6162.  For example, the following command will detach a copy of 4OS2 to run the batch 
  6163.  file XYZ.BTM : 
  6164.  
  6165.           [c:\] detach xyz.btm
  6166.  
  6167.  Once the program has started, 4OS2 returns to the prompt immediately.  It does 
  6168.  not wait for a detached program to finish. 
  6169.  
  6170.  
  6171. ΓòÉΓòÉΓòÉ 14.18. DIR - Display directories ΓòÉΓòÉΓòÉ
  6172.  
  6173.  Purpose:    Display information about files and subdirectories. 
  6174.  
  6175.  Format:     DIR [/1 /2 /4 /A[[:][-]rhsda] /B /D /E /F /H /I"text" /J /K /L /M 
  6176.              /N /O[[:][-]adeginrsu] /P /R /S /T[:acw] /U /V /W /Z] [file...] 
  6177.  
  6178.              file :  The file, directory, or list of files or directories to 
  6179.              display. 
  6180.  
  6181.              /1 (one column)                 /L(ower case) 
  6182.              /2 (two columns)                /M (suppress footer) 
  6183.              /4 (four columns)               /N(ew format) 
  6184.              /A(ttribute select)             /O(rder) 
  6185.              /B(are)                         /P(ause) 
  6186.              /D(isable color coding)         /R (disable wRap) 
  6187.              /E (use upper case)             /S(ubdirectories) 
  6188.              /F(ull path)                    /T (aTtribute) or (Time) 
  6189.              /H(ide dots)                    /U (sUmmary information) 
  6190.              /I (match descriptions)         /V(ertical sort) 
  6191.              /J(ustify names)                /W(ide) 
  6192.              /K (suppress header)            /Z (use FAT format) 
  6193.  
  6194.  See also:  ATTRIB, DESCRIBE, SELECT, and SETDOS. 
  6195.  
  6196.  File Selection 
  6197.  
  6198.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  6199.  
  6200.  Usage 
  6201.  
  6202.  DIR can be used to display information about files from one or more of your 
  6203.  disk directories, in a wide range of formats.  Depending on the options 
  6204.  chosen, you can display the file name, attributes, and size; the time and date 
  6205.  of the last change to the file; the file description; and the file's 
  6206.  compression ratio.  You can also display information in 1, 2, 4, or 5 columns, 
  6207.  sort the files several different ways, use color to distinguish file types, 
  6208.  and pause after each full screen. 
  6209.  
  6210.  The various DIR displays are controlled through options or switches.  The best 
  6211.  way to learn how to use the many options available with the DIR command is to 
  6212.  experiment.  You will soon know which options you want to use regularly.  You 
  6213.  can select those options permanently by using the ALIAS command. 
  6214.  
  6215.  On HPFS drives, DIR will use the standard long name display format with the 
  6216.  filename at the right-hand side of the display.  File descriptions are not 
  6217.  displayed in this format.  To switch to the more traditional FAT (short name) 
  6218.  format, and display the file descriptions, use the /Z switch. 
  6219.  
  6220.  You may want to mix several options.  For example, to display all the files in 
  6221.  the current directory, in 2 columns, sorted vertically (down one column then 
  6222.  down the next), and with a pause at the end of each page: 
  6223.  
  6224.           [c:\] dir /2/p/v
  6225.  
  6226.  To set up this format as the default, using an alias: 
  6227.  
  6228.           [c:\] alias dir=*dir /2/p/v
  6229.  
  6230.  This example displays all the files on all directories of drive C, including 
  6231.  hidden and system files, pausing after each page: 
  6232.  
  6233.           [c:\] dir /s/a/p c:\
  6234.  
  6235.  DIR allows wildcard characters (* and ?) in the filename.  If you don't 
  6236.  specify a filename, DIR defaults to *.* (display all non- hidden files and 
  6237.  subdirectories in the current directory).  To display all of the .WKS files in 
  6238.  the current directory: 
  6239.  
  6240.           [c:\] dir *.wks
  6241.  
  6242.  With the /I option, DIR can select files to display based on their 
  6243.  descriptions.  DIR will display a file if its description matches the text 
  6244.  after the /I switch.  The search is not case sensitive.  You can use wildcards 
  6245.  and extended wildcards as part of the text.  For example, to display any file 
  6246.  described as a "Test File" you can use this command: 
  6247.  
  6248.           [c:\] dir /i"test file"
  6249.  
  6250.  If you want to display files that include the words "test file" anywhere in 
  6251.  their descriptions, use extended wild cards like this: 
  6252.  
  6253.           [c:\] dir /i"*test file*"
  6254.  
  6255.  If you link two or more filenames together with spaces, DIR will display all 
  6256.  of the files that match the first name and then all of the files that match 
  6257.  the second name.  You may use a different drive and path for each filename. 
  6258.  This example lists all of the .WKS and then all of the .WK1 files in the 
  6259.  current directory: 
  6260.  
  6261.           [c:\] dir *.wks *.wk1
  6262.  
  6263.  If you use an include list to link multiple filenames, DIR will display the 
  6264.  matching filenames in a single listing.  Only the first filename in an include 
  6265.  list can have a path; the other files must be in the same path.  This example 
  6266.  displays the same files as the previous example, but the .WKS and .WK1 files 
  6267.  are intermixed: 
  6268.  
  6269.           [c:\] dir *.wks;*.wk1
  6270.  
  6271.  You can display the file and subdirectory names in color by setting the 
  6272.  COLORDIR environment variable or using the ColorDir directive in your .INI 
  6273.  file.  See Color-Coded Directories for details. 
  6274.  
  6275.  If you are using color-coded directories and attempt to redirect the output of 
  6276.  DIR to a character device, such as a serial port or the printer, 
  6277.  non-color-coded file names will be displayed on the device but color-coded 
  6278.  names may still be displayed on the screen. This will not occur if the output 
  6279.  of DIR is redirected to a disk file.  To prevent this problem, use the /D 
  6280.  switch to disable color coding when redirecting the output of DIR to a 
  6281.  character device. 
  6282.  
  6283.  By default, 4OS2 will display filenames in lower case on FAT drives, and in 
  6284.  the case in which the filenames are stored on HPFS drives (HPFS drives support 
  6285.  upper-case, lower-case, and mixed-case filenames).  You can override these 
  6286.  defaults and force filenames to display in upper case with /E, or in lower 
  6287.  case with /L. 
  6288.  
  6289.  When displaying file descriptions, DIR will wrap long lines to fit on the 
  6290.  screen.  DIR displays a maximum of 40 characters of text in each line of a 
  6291.  description, unless your screen width allows a wider display.  If you disable 
  6292.  description wrapping with the /R switch, the description is truncated at the 
  6293.  right edge of the screen, and a right arrow is added at the end of the line to 
  6294.  alert you to the existence of additional description text. 
  6295.  
  6296.  If you attempt to redirect the output of DIR to a character device, such as a 
  6297.  serial port or the printer, long descriptions will be wrapped at the screen 
  6298.  width in the redirected output.  If this is not what you want, use /R to 
  6299.  disable wrapping. 
  6300.  
  6301.  When sorting file names and extensions, 4OS2 normally assumes that sequences 
  6302.  of digits should be sorted numerically (for example, the file DRAW2 would come 
  6303.  before DRAW03 because 2 is numerically smaller than 03), rather than strictly 
  6304.  alphabetically (where DRAW2 would come second because "2" is after "0" in 
  6305.  alphanumeric order). You can defeat this behavior and force a strict 
  6306.  alphabetic sort with the /O:a option. 
  6307.  
  6308.  If you have selected a specific country code for your system, DIR will display 
  6309.  the date in the format for that country.  The default date format is U.S. 
  6310.  (mm-dd-yy).  The separator character in the file time will also be affected by 
  6311.  the country code. 
  6312.  
  6313.  DIR can handle directories of any size, limited only by available memory. 
  6314.  Memory requirements for DIR are generally not a concern under 4OS2, because of 
  6315.  the virtual memory available under these operating systems. 
  6316.  
  6317.  Options on the command line apply only to the filenames which follow the 
  6318.  option, and options at the end of the line apply to the preceding filename 
  6319.  only.  This allows you to specify different options for different groups of 
  6320.  files, yet retains compatibility with the traditional DIR command when a 
  6321.  single filename is specified. 
  6322.  
  6323.  Options 
  6324.  
  6325.     /1:     Single column display -- display the filename, size, date, time, 
  6326.             and description.  This is the default. If /T is used the attributes 
  6327.             are displayed instead of the description; if /C or /O:c is used the 
  6328.             compression ratio is displayed instead of the description. 
  6329.  
  6330.     /2:     Two column display -- display the filename, size, date, and time. 
  6331.             If you use /2 (or /4) on an HPFS drive, DIR will only display the 
  6332.             file names.  Also, the number of columns may be reduced to one for 
  6333.             names too long to fit on half the screen.  Due to these 
  6334.             restrictions, /2 is normally most useful on HPFS drives when used 
  6335.             with /Z to force the display to FAT format. 
  6336.  
  6337.     /4:     Four column display -- display the filename and size, in K 
  6338.             (kilobytes) or M (megabytes).  The note under /2 above regarding 
  6339.             HPFS drives applies to /4 as well. 
  6340.  
  6341.     /A:     (Attribute select) Select only those files that have the specified 
  6342.             attribute(s) set.  Preceding the attribute character with a hyphen 
  6343.             [-] will select files that do not have that attribute set.  The 
  6344.             colon [:] after /A is optional.  The attributes are: attributes 
  6345.             are: 
  6346.  
  6347.               R  Read-only 
  6348.               H  Hidden 
  6349.               S  System 
  6350.               D  Subdirectory 
  6351.               A  Archive 
  6352.  
  6353.             If no attributes are listed at all (e.g., DIR /A ...), DIR will 
  6354.             display all files and subdirectories including hidden and system 
  6355.             files.  If attributes are combined, all the specified attributes 
  6356.             must match for a file to be included in the listing.  For example, 
  6357.             /A:RHS will display only those files with all three attributes set. 
  6358.  
  6359.     /B:     (Bare)  Suppress the header and summary lines, and display file or 
  6360.             subdirectory names only, in a single column. This option is most 
  6361.             useful when you want to redirect a list of names to a file or 
  6362.             another program.  If you use /B with /S, DIR will show the full 
  6363.             path of each file instead of simply its name and extension. 
  6364.  
  6365.     /D:     (Disable color coding)  Temporarily disable directory color coding. 
  6366.             May be required when color-coded directories are used and DIR 
  6367.             output is redirected to a character device like the printer (e.g., 
  6368.             PRN or LPT1) or serial port (e.g., COM1 or COM2).  /D is not 
  6369.             required when DIR output is redirected to a file. 
  6370.  
  6371.     /E:     Display filenames in the traditional upper case; also see SETDOS /U 
  6372.             and the UpperCase directive in 4OS2.INI. 
  6373.  
  6374.     /F:     (Full path)  Display each filename with its drive letter and path 
  6375.             in a single column, without other information. 
  6376.  
  6377.     /H:     (Hide dots)  Suppress the display of the "." and ".." directories. 
  6378.  
  6379.     /I:     Display filenames by matching text in their descriptions.  The text 
  6380.             can include wild cards and extended wildcards.  The search text 
  6381.             must be enclosed in quotation marks.  /I may be used to select 
  6382.             files even if descriptions are not displayed (for example, if /2 is 
  6383.             used).  However, /I will be ignored if /C or /O:c is used. 
  6384.  
  6385.     /J:     (Justify names)  Justify (align) filename extensions and display 
  6386.             them in the traditional format. 
  6387.  
  6388.     /K:     Suppress the header (disk and directory name) display. 
  6389.  
  6390.     /L:     (Lower case)  Display file and directory names in lower case; also 
  6391.             see SETDOS /U and the UpperCase directive in 4OS2.INI. 
  6392.  
  6393.     /M:     Suppress the footer (file and byte count totals) display. 
  6394.  
  6395.     /N:     Use the HPFS display format, even if the files are stored on a FAT 
  6396.             file system volume. 
  6397.  
  6398.     /O:     (Order) Set the sorting order.  You may use any combination of the 
  6399.             following sorting options; if multiple options are used, the 
  6400.             listing will be sorted with the first sort option as the primary 
  6401.             key, the next as the secondary key, and so on: 
  6402.  
  6403.               -  Reverse the sort order for the next option 
  6404.               a  Sort in ASCII order, not numerically, when there are digits in 
  6405.             the name 
  6406.               d  Sort by date and time (oldest first); for HPFS drives also see 
  6407.             /T 
  6408.               e  Sort by extension 
  6409.               g  Group subdirectories first, then files 
  6410.               i  Sort by file description (ignored if /C or /O:c is used) 
  6411.               n  Sort by filename (this is the default) 
  6412.               r  Reverse the sort order for all options 
  6413.               s  Sort by size 
  6414.               u  Unsorted 
  6415.  
  6416.     /P:     (Pause)  Wait for a key to be pressed after each screen page before 
  6417.             continuing the display.  Your options at the prompt are explained 
  6418.             in detail under Page and File Prompts. 
  6419.  
  6420.     /R      (disable wRap)  Forces long descriptions to be displayed on a 
  6421.             single line, rather than wrapped onto two or more lines.  Use /R 
  6422.             when output is redirected to a character device, such as a serial 
  6423.             port or the printer; or when you want descriptions truncated, 
  6424.             rather than wrapped, in the on-screen display. 
  6425.  
  6426.     /S:     (Subdirectories)  Display file information from the current 
  6427.             directory and all of its subdirectories.  DIR will only display 
  6428.             headers and summaries for those directories which contain files 
  6429.             that match the filename(s) and attributes (if /A is used) that you 
  6430.             specify on the command line. 
  6431.  
  6432.     /T      (aTtribute display)  Display the filenames, attributes, and 
  6433.             descriptions.  The descriptions will be wrapped onto the next line, 
  6434.             if necessary, unless you also use the /R (truncate) option.  If you 
  6435.             use both /T and /R, descriptions are truncated after 34 characters 
  6436.             on an 80-column display.  The attributes are displayed in the 
  6437.             format RHSA, with the following meanings: 
  6438.  
  6439.               R  Read-only 
  6440.               H  Hidden 
  6441.               S  System 
  6442.               A  Archive 
  6443.             If you wish to add another option after /T, you must start the next 
  6444.             option with a forward slash.  If you don't, 4OS2 will interpret the 
  6445.             /T as the time display switch and the following character as a 
  6446.             valid or invalid time selector  For example: 
  6447.  
  6448.                                         [c:\] dir /tz             incorrect, will display error
  6449.                                         [c:\] dir /t/z            correct
  6450.  
  6451.  
  6452.     /T:acw  (Time display)  Specify which of the date and time fields on an 
  6453.             HPFS drive should be displayed and used for sorting: 
  6454.  
  6455.               a  Last access time 
  6456.               c  Creation time 
  6457.               w  Last write time (default) 
  6458.  
  6459.     /U      (sUmmary information)  Only display the number of files, the total 
  6460.             file size, and the total amount of disk space used. 
  6461.  
  6462.     /V:     (Vertical sort)  Display the filenames sorted vertically rather 
  6463.             than horizontally (use with the /2, /4 or /W options). 
  6464.  
  6465.     /W:     (Wide)  Display filenames only, horizontally across the screen (5 
  6466.             columns on an 80-character wide display). 
  6467.  
  6468.     /Z:     Display an HPFS directory in FAT format.  Long names will be 
  6469.             truncated to 12 characters.  If the name is longer than 12 
  6470.             characters, it will be followed by a right arrow to show that one 
  6471.             or more characters have been truncated. 
  6472.  
  6473.  
  6474. ΓòÉΓòÉΓòÉ 14.19. DIRS - Display the directory stack ΓòÉΓòÉΓòÉ
  6475.  
  6476.  Purpose:    Display the current directory stack. 
  6477.  
  6478.  Format:     DIRS 
  6479.  
  6480.  See also:  PUSHD and POPD. 
  6481.  
  6482.  Usage 
  6483.  
  6484.  The PUSHD command adds the current default drive and directory to the 
  6485.  directory stack, a list that 4OS2 maintains in memory.  The POPD command 
  6486.  removes the top entry of the directory stack and makes that drive and 
  6487.  directory the new default.  The DIRS command displays the contents of the 
  6488.  directory stack, with the most recent entries on top (i.e., the next POPD will 
  6489.  retrieve the first entry that DIRS displays). 
  6490.  
  6491.  The directory stack holds 255 characters, enough for 10 to 20 typical drive 
  6492.  and directory entries. 
  6493.  
  6494.  
  6495. ΓòÉΓòÉΓòÉ 14.20. DO - Create loops in batch files ΓòÉΓòÉΓòÉ
  6496.  
  6497.  Purpose:    Create loops in batch files. 
  6498.  
  6499.  Format:     DO [n | FOREVER] 
  6500.                 or 
  6501.              DO varname = start TO end [BY n ] 
  6502.                 or 
  6503.              DO [WHILE | UNTIL] condition 
  6504.                 ... 
  6505.              [ITERATE] 
  6506.              [LEAVE] 
  6507.                 ... 
  6508.              ENDDO 
  6509.  
  6510.              n, start, end :  An integer between 0 and 2,147,483,647 inclusive, 
  6511.              or an internal variable or variable function that evaluates to 
  6512.              such a value. 
  6513.              varname :  The environment variable that will hold the loop 
  6514.              counter. 
  6515.              condition :  A test to determine if the loop should be executed. 
  6516.  
  6517.  Usage 
  6518.  
  6519.  DO can only be used in batch files.  It cannot be used in aliases. 
  6520.  
  6521.  DO can be used to create 3 different kinds of loops.  The first, introduced by 
  6522.  DO n, is a counted loop.  The batch file lines between DO and ENDDO are 
  6523.  repeated n times.  You can also specify "forever" for n if you wish to create 
  6524.  an endless loop. For example: 
  6525.  
  6526.           do 5
  6527.              beep
  6528.           enddo
  6529.  
  6530.  The second type of loop is similar to a "for loop" in programming languages 
  6531.  like BASIC.  DO creates an environment variable, varname, and sets it equal to 
  6532.  the value start (if varname already exists in the environment, it will be 
  6533.  overwritten).  DO then begins the loop process by comparing the value of 
  6534.  varname with the value of end.  If varname is less than or equal to end, DO 
  6535.  executes the batch file lines up to the ENDDO.  Next, DO adds 1 to the value 
  6536.  of varname, or adds the value n if BY n is specified, and repeats the compare 
  6537.  and execute process until varname is greater than end. This example displays 
  6538.  the even numbers from 2 through 20: 
  6539.  
  6540.           do i = 2 to 20 by 2
  6541.              echo %i
  6542.           enddo
  6543.  
  6544.  DO can also count down, rather than up.  If n is negative, varname will 
  6545.  decrease by n with each loop, and the loop will stop when varname is less than 
  6546.  end.  For example, to display the even numbers from 2 through 20 in reverse 
  6547.  order, replace the first line of the example above with: 
  6548.  
  6549.           do i = 20 to 2 by -2
  6550.  
  6551.  The third type of loop is called a "while loop" or "until loop." DO evaluates 
  6552.  the condition, which can be any of the tests supported by the IF command, and 
  6553.  executes the lines between DO and ENDDO as long as the condition is true.  The 
  6554.  loop ends when the condition becomes false. 
  6555.  
  6556.  WHILE tests the condition at the start of the loop; UNTIL tests it at the end. 
  6557.  If you use WHILE, the loop may never be executed (if the condition is false at 
  6558.  the start of the loop); if you use UNTIL, the loop will always be executed at 
  6559.  least once. 
  6560.  
  6561.  Two special commands, ITERATE and LEAVE, can only be used inside a DO / ENDDO 
  6562.  loop.  ITERATE ignores the remaining lines inside the loop and returns to the 
  6563.  beginning of loop for another iteration (unless DO determines that the loop is 
  6564.  finished).  LEAVE exits from the current DO loop and continues with the line 
  6565.  following ENDDO. Both ITERATE and LEAVE are most often used in an IF or IFF 
  6566.  command: 
  6567.  
  6568.           do while "%var" != "%val1"
  6569.              ...
  6570.              if "%var" == "%val2" leave
  6571.           enddo
  6572.  
  6573.  You can nest DO loops up to 15 levels deep. 
  6574.  
  6575.  The DO and ENDDO commands must be on separate lines, and cannot be placed 
  6576.  within a command group, or on the same line as other commands (this is the 
  6577.  reason DO cannot be used in aliases).  However, commands within the DO loop 
  6578.  can use command groups or the command separator in the normal way. 
  6579.  
  6580.  For example, the following command will not work properly, because the DO and 
  6581.  ENDDO are inside a command group and are not on separate lines: 
  6582.  
  6583.        if "%a" == "%b" (do i = 1 to 10 & echo %i & enddo)
  6584.  
  6585.  However this batch file fragment uses multiple commands and command grouping 
  6586.  within the DO, and will work properly: 
  6587.  
  6588.        do i = 1 to 10
  6589.           ...
  6590.           if "%x1" == "%x2" (echo Done! & leave)
  6591.        enddo
  6592.  
  6593.  You can exit from all DO / ENDDO loops by using GOTO to a line past the last 
  6594.  ENDDO.  However, be sure to read the cautionary notes about GOTO and DO under 
  6595.  the GOTO command before using a GOTO inside any DO loop. 
  6596.  
  6597.  
  6598. ΓòÉΓòÉΓòÉ 14.21. DPATH - Set the data search path ΓòÉΓòÉΓòÉ
  6599.  
  6600.  Purpose:    Specify the subdirectories which applications will search to find 
  6601.              files that are not in the current directory. 
  6602.  
  6603.  Format:     DPATH [directory [;directory... ]] 
  6604.  
  6605.              directory :  The full name of a directory to include in the DPATH 
  6606.              (data path) setting. 
  6607.  
  6608.  See also:  PATH, SET, and ESET. 
  6609.  
  6610.  Usage 
  6611.  
  6612.  When most OS/2 applications try to open a data file, they look for the file in 
  6613.  the current directory first.  If they fail to find the file there, they search 
  6614.  each of the directories in the DPATH setting in the order that they are 
  6615.  included.  Internal commands like TYPE do not search the DPATH directories for 
  6616.  files. 
  6617.  
  6618.  For example, the following DPATH command directs applications to look for 
  6619.  files in this order:  the current directory, the INIT directory on C, and the 
  6620.  CONFIG directory on D: 
  6621.  
  6622.           [c:\] dpath c:\init;d:\config
  6623.  
  6624.  The listing of directories to be searched can be set or viewed with DPATH. 
  6625.  The list is stored as an environment string with the variable name DPATH, and 
  6626.  can also be set or viewed with the SET command and edited with the ESET 
  6627.  command. 
  6628.  
  6629.  Directory names in the DPATH must be separated with semicolons [;].  4OS2 will 
  6630.  not shift directory names in the DPATH to upper case as it does with those in 
  6631.  the PATH setting.  If you want the names in the DPATH to be in upper case you 
  6632.  must enter them that way. 
  6633.  
  6634.  If you enter DPATH with no parameters, 4OS2 displays the current DPATH search 
  6635.  list. 
  6636.  
  6637.  
  6638. ΓòÉΓòÉΓòÉ 14.22. DRAWBOX - Draw a box ΓòÉΓòÉΓòÉ
  6639.  
  6640.  Purpose:    Draw a box on the screen. 
  6641.  
  6642.  Format:     DRAWBOX ulrow ulcol lrrow lrcol style [BRIght] [BLInk] fg ON 
  6643.              [BRIght] bg [FILl [BRIght] bgfill ] [ZOOm] [SHAdow] 
  6644.  
  6645.              ulrow :  Row for upper left corner 
  6646.              ulcol :  Column for upper left corner 
  6647.              lrrow :  Row for lower right corner 
  6648.              lrcol :  Column for lower right corner 
  6649.              style :  Box drawing style: 
  6650.              0   No lines (box is drawn with blanks) 
  6651.              1   Single line 
  6652.              2   Double line 
  6653.              3   Single line on top and bottom, double on sides 
  6654.              4   Double line on top and bottom, single on sides 
  6655.              fg :  Foreground character color 
  6656.              bg :  Background character color 
  6657.              bgfill :  Background fill color (for the inside of the box) 
  6658.  
  6659.  See also:  DRAWHLINE and DRAWVLINE. 
  6660.  
  6661.  Usage 
  6662.  
  6663.  DRAWBOX is useful for creating attractive screen displays in batch files. 
  6664.  
  6665.  For example, to draw a box around the entire screen with bright white lines on 
  6666.  a blue background: 
  6667.  
  6668.           drawbox 0 0 24 79 1 bri whi on blu fill blu
  6669.  
  6670.  See Colors and Color Names for details about colors and notes on the use of 
  6671.  bright background colors. 
  6672.  
  6673.  If you use ZOOM, the box appears to grow in steps to its final size.  The 
  6674.  speed of the zoom operation depends on the speed of your video system. 
  6675.  
  6676.  If you use SHADOW, a drop shadow is created by changing the characters in the 
  6677.  row under the box and the 2 columns to the right of the box to normal 
  6678.  intensity text with a black background (this will make characters displayed in 
  6679.  black disappear entirely). 
  6680.  
  6681.  The row and column values are zero-based, so on a standard 25 line by 80 
  6682.  column display, valid rows are 0 - 24 and valid columns are 0 - 79. 
  6683.  
  6684.  DRAWBOX checks for valid row and column values, and displays a "Usage" error 
  6685.  message if any values are out of range. 
  6686.  
  6687.  Unlike DRAWHLINE and DRAWVLINE, DRAWBOX does not automatically connect boxes 
  6688.  to existing lines on the screen with the proper connector characters.  If you 
  6689.  want to draw lines inside a box and have the proper connectors drawn 
  6690.  automatically, draw the box first, then use DRAWHLINE and DRAWVLINE to draw 
  6691.  the lines. 
  6692.  
  6693.  DRAWBOX uses the standard line and box drawing characters in the U.S. English 
  6694.  extended ASCII character set.  If your system is configured for a different 
  6695.  country or language, the box may not appear on your screen as you expect. 
  6696.  
  6697.  
  6698. ΓòÉΓòÉΓòÉ 14.23. DRAWHLINE - Draw a horizontal line ΓòÉΓòÉΓòÉ
  6699.  
  6700.  Purpose:    Draw a horizontal line on the screen. 
  6701.  
  6702.  Format:     DRAWHLINE row column len style [BRIght] [BLInk] fg ON [BRIght] bg 
  6703.  
  6704.              row :  Starting row 
  6705.              column :  Starting column 
  6706.              len :  Length of line 
  6707.              style :  Line drawing style: 
  6708.              1   Single line 
  6709.              2   Double line 
  6710.              fg :  Foreground character color 
  6711.              bg :  Background character color 
  6712.  
  6713.  See also:  DRAWBOX and DRAWVLINE. 
  6714.  
  6715.  Usage 
  6716.  
  6717.  DRAWHLINE is useful for creating attractive screen displays in batch files. 
  6718.  It detects other lines and boxes on the display, and creates the appropriate 
  6719.  connector characters when possible (not all types of lines can be connected 
  6720.  with the available characters). 
  6721.  
  6722.  For example, the following command draws a double line along the top row of 
  6723.  the display with green characters on a blue background: 
  6724.  
  6725.           drawhline 0 0 80 2 green on blue
  6726.  
  6727.  The row and column values are zero-based, so on a standard 25 line by 80 
  6728.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  DRAWHLINE 
  6729.  checks for a valid row and column, and displays a "Usage" error message if 
  6730.  either value is out of range. 
  6731.  
  6732.  See Colors and Color Names for details about colors and notes on the use of 
  6733.  bright background colors. 
  6734.  
  6735.  DRAWHLINE uses the standard line and box drawing characters in the U.S. 
  6736.  English extended ASCII character set.  If your system is configured for a 
  6737.  different country or language, the line may not appear on your screen as you 
  6738.  expect. 
  6739.  
  6740.  
  6741. ΓòÉΓòÉΓòÉ 14.24. DRAWVLINE - Draw a vertical line ΓòÉΓòÉΓòÉ
  6742.  
  6743.  Purpose:    Draw a vertical line on the screen. 
  6744.  
  6745.  Format:     DRAWVLINE row column len style [BRIght][BLInk] fg ON [BRIght] bg 
  6746.  
  6747.              row :  Starting row 
  6748.              column :  Starting column 
  6749.              len :  Length of line 
  6750.              style :  Line drawing style: 
  6751.              1   Single line 
  6752.              2   Double line 
  6753.              fg :  Foreground character color 
  6754.              bg :  Background character color 
  6755.  
  6756.  See also:  DRAWBOX and DRAWHLINE. 
  6757.  
  6758.  Usage 
  6759.  
  6760.  DRAWVLINE is useful for creating attractive screen displays in batch files. 
  6761.  It detects other lines and boxes on the display, and creates the appropriate 
  6762.  connector characters when possible (not all types of lines can be connected 
  6763.  with the available characters). 
  6764.  
  6765.  For example, to draw a double width line along the left margin of the display 
  6766.  with bright red characters on a black background: 
  6767.  
  6768.           drawvline 0 0 25 2 bright red on black
  6769.  
  6770.  The row and column values are zero-based, so on a standard 25 line by 80 
  6771.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  DRAWVLINE 
  6772.  checks for a valid row and column, and displays a "Usage" error message if 
  6773.  either value is out of range. 
  6774.  
  6775.  See Colors and Color Names for details about colors and notes on the use of 
  6776.  bright background colors. 
  6777.  
  6778.  DRAWVLINE uses the standard line and box drawing characters in the U.S. 
  6779.  English extended ASCII character set.  If your system is configured for a 
  6780.  different country or language, the line may not appear on your screen as you 
  6781.  expect. 
  6782.  
  6783.  
  6784. ΓòÉΓòÉΓòÉ 14.25. ECHO - Display a message / set echo state ΓòÉΓòÉΓòÉ
  6785.  
  6786.  Purpose:    Display a message, enable or disable batch file or command-line 
  6787.              echoing, or display the echo status. 
  6788.  
  6789.  Format:     ECHO [ON | OFF | message ] 
  6790.  
  6791.              message :  Text to display. 
  6792.  
  6793.  See also:  ECHOS, SCREEN, SCRPUT, SETDOS and TEXT. 
  6794.  
  6795.  Usage 
  6796.  
  6797.  4OS2 has a separate echo capability for batch files and for the command line. 
  6798.  The command-line ECHO state is independent of the batch file ECHO state; 
  6799.  changing ECHO in a batch file has no effect on the display at the command 
  6800.  prompt, and vice versa. 
  6801.  
  6802.  To see the current echo state, use the ECHO command with no arguments.  This 
  6803.  displays either the batch file or command-line echo state, depending on where 
  6804.  the ECHO command is performed. 
  6805.  
  6806.  In a batch file, if you turn ECHO on, each line of the file is displayed 
  6807.  before it is executed.  If you turn ECHO off, each line is executed without 
  6808.  being displayed.  ECHO can also be used in a batch file to display a message 
  6809.  on the screen.  Regardless of the ECHO state, a batch file line that begins 
  6810.  with the [@] character will not be displayed.  To turn off batch file echoing, 
  6811.  without displaying the ECHO command, use this line: 
  6812.  
  6813.           @echo off
  6814.  
  6815.  ECHO commands in a batch file will send messages to the screen while the batch 
  6816.  file executes, even if ECHO is set OFF.  For example, this line will display a 
  6817.  message in a batch file: 
  6818.  
  6819.           echo Processing your print files...
  6820.  
  6821.  If you want to echo a blank line from within a batch file, enter: 
  6822.  
  6823.           echo.
  6824.  
  6825.  You cannot use the command separator character [&], or the redirection symbols 
  6826.  [| > <] in an ECHO message, unless you enclose them in quotes (see Argument 
  6827.  Quoting) or precede them with the escape character. 
  6828.  
  6829.  ECHO defaults to ON in batch files.  The current ECHO state is inherited by 
  6830.  called batch files.  You can change the default setting to ECHO OFF with the 
  6831.  SETDOS /V0 command or the BatchEcho directive in the .INI file. 
  6832.  
  6833.  If you turn the command-line ECHO on, each command will be displayed before it 
  6834.  is executed.  This will let you see the command line after expansion of all 
  6835.  aliases and variables.  The command- line ECHO is most useful when you are 
  6836.  learning how to use advanced features.  This example will turn command-line 
  6837.  echoing on: 
  6838.  
  6839.           [c:\] echo on
  6840.  
  6841.  ECHO defaults to OFF at the command line. 
  6842.  
  6843.  
  6844. ΓòÉΓòÉΓòÉ 14.26. ECHOS - Display a message without CR/LF ΓòÉΓòÉΓòÉ
  6845.  
  6846.  Purpose:    Display a message without a trailing carriage return and line 
  6847.              feed. 
  6848.  
  6849.  Format:     ECHOS message 
  6850.  
  6851.  See also:  ECHO, SCREEN, SCRPUT, TEXT, and VSCRPUT. 
  6852.  
  6853.  Usage 
  6854.  
  6855.  ECHOS is useful for text output when you don't want to add a carriage return / 
  6856.  linefeed pair at the end of the line.  For example, you can use ECHOS when you 
  6857.  need to redirect control sequences to your printer; this example sends the 
  6858.  sequence Esc P to the printer on LPT1: 
  6859.  
  6860.           [c:\] echos ^eP > lpt1:
  6861.  
  6862.  You cannot use the command separator character [&] or the redirection symbols 
  6863.  [| > <] in an ECHOS message, unless you enclose them in quotes (see Argument 
  6864.  Quoting) or precede them with the escape character. 
  6865.  
  6866.  ECHOS does not translate or modify the message text.  For example, carriage 
  6867.  return characters are not translated to CR/LF pairs. ECHOS sends only the 
  6868.  characters you enter (after escape character and back quote processing).  The 
  6869.  only character you cannot put into an ECHOS message is the NUL character 
  6870.  (ASCII 0). 
  6871.  
  6872.  
  6873. ΓòÉΓòÉΓòÉ 14.27. ENDLOCAL - Restore the saved environment ΓòÉΓòÉΓòÉ
  6874.  
  6875.  Purpose:    Restore the saved disk drive, directory, environment, and alias 
  6876.              list. 
  6877.  
  6878.  Format:     ENDLOCAL 
  6879.  
  6880.  See also:  SETLOCAL. 
  6881.  
  6882.  Usage 
  6883.  
  6884.  The SETLOCAL command in a batch file saves the current disk drive, default 
  6885.  directory, all environment variables, and the alias list. ENDLOCAL restores 
  6886.  everything that was saved by the previous SETLOCAL command. 
  6887.  
  6888.  SETLOCAL and ENDLOCAL can only be used in batch files, not in aliases or from 
  6889.  the command line. 
  6890.  
  6891.  
  6892. ΓòÉΓòÉΓòÉ 14.28. ESET - Edit environment variables and aliases ΓòÉΓòÉΓòÉ
  6893.  
  6894.  Purpose:    Edit environment variables and aliases. 
  6895.  
  6896.  Format:     ESET [/A] variable name... 
  6897.  
  6898.              variable name :  The name of an environment variable or alias to 
  6899.              edit. 
  6900.  
  6901.              /A(lias) 
  6902.  
  6903.  See also:  ALIAS, UNALIAS, SET, and UNSET. 
  6904.  
  6905.  Usage 
  6906.  
  6907.  ESET allows you to edit environment variables and aliases using line editing 
  6908.  commands (see Command-Line Editing). 
  6909.  
  6910.  For example, to edit the executable file search path: 
  6911.  
  6912.           [c:\] eset path
  6913.           path=c:\;c:\dos;c:\util
  6914.  
  6915.  To create and then edit an alias: 
  6916.  
  6917.           [c:\] alias d = dir /d/j/p
  6918.           [c:\] eset d
  6919.           d=dir /d/j/p
  6920.  
  6921.  ESET will search for environment variables first and then aliases. If you have 
  6922.  an environment variable and an alias with the same name, ESET will edit the 
  6923.  environment variable and ignore the alias unless you use the /A option. 
  6924.  
  6925.  Environment variable and alias names are normally limited to 80 characters, 
  6926.  and their contents to 1,023 characters.  However, if you use special 
  6927.  techniques to create a longer environment variable, ESET will edit it provided 
  6928.  the variable contains no more than 2,047 characters of text. 
  6929.  
  6930.  If you have enabled global aliases (see ALIAS), any changes made to an alias 
  6931.  with ESET will immediately affect all other copies of 4OS2 which are using the 
  6932.  same alias list. 
  6933.  
  6934.  Option 
  6935.  
  6936.     /A:     (Alias) Edit the named alias even if an environment variable of the 
  6937.             same name exists.  If you have an alias and an environment variable 
  6938.             with the same name, you must use this switch to be able to edit the 
  6939.             alias. 
  6940.  
  6941.  
  6942. ΓòÉΓòÉΓòÉ 14.29. EXCEPT - Exclude files from a command ΓòÉΓòÉΓòÉ
  6943.  
  6944.  Purpose:    Perform a command on all available files except those specified. 
  6945.  
  6946.  Format:     EXCEPT (file ) command 
  6947.  
  6948.              file :  The file or files to exclude from the command. 
  6949.              command :  The command to execute, including all appropriate 
  6950.              arguments and switches. 
  6951.  
  6952.  See also:  ATTRIB. 
  6953.  
  6954.  File Selection 
  6955.  
  6956.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  6957.  Date, time, or size ranges must appear immediately after the EXCEPT keyword. 
  6958.  
  6959.  Usage 
  6960.  
  6961.  EXCEPT provides a means of executing a command on a group of files and/or 
  6962.  subdirectories, and excluding a subgroup from the operation. The command can 
  6963.  be an internal command or alias, an external command, or a batch file. 
  6964.  
  6965.  You may use wildcards to specify the files to exclude from the command.  The 
  6966.  first example erases all the files in the current directory except those 
  6967.  beginning with MEMO, and those whose extension is .WKS.  The second example 
  6968.  copies all the files and subdirectories on drive C to drive D except those in 
  6969.  C:\MSC and C:\DOS, using the COPY command: 
  6970.  
  6971.           [c:\] except (memo*.* *.wks) erase *.*
  6972.           [c:\] except (c:\msc c:\dos) copy c:\*.* d:\ /s
  6973.  
  6974.  Date, time, and size ranges can be used immediately after the word EXCEPT to 
  6975.  further qualify which files should be excluded from the command.  If the 
  6976.  command is an internal command that supports ranges, an independent range can 
  6977.  also be used in the command itself. 
  6978.  
  6979.  EXCEPT prevents operations on the specified file(s) by setting the hidden 
  6980.  attribute, performing the command, and then clearing the hidden attribute.  If 
  6981.  the command is aborted in an unusual way, you may need to use the ATTRIB 
  6982.  command to remove the hidden attribute from the file(s). 
  6983.  
  6984.  Caution:  EXCEPT will not work with programs or commands that ignore the 
  6985.  hidden attribute or which work explicitly with hidden files, including DEL /Z, 
  6986.  and the /H (process hidden files) switch available in some 4OS2 file 
  6987.  processing commands. 
  6988.  
  6989.  You can use command grouping to execute multiple commands with a single 
  6990.  EXCEPT.  For example, the following command copies all files in the current 
  6991.  directory whose extensions begin with .DA, except the .DAT files, to the 
  6992.  D:\SAVE directory, then changes the first two characters of the extension of 
  6993.  the copied files to .SA: 
  6994.  
  6995.           [c:\data] except (*.dat) (copy *.da* d:\save & ren *.da* *.sa*)
  6996.  
  6997.  If you use filename completion (see Filename Completion) to enter the 
  6998.  filenames inside the parentheses, type a space after the open parenthesis 
  6999.  before entering a partial filename or pressing Tab.  Otherwise, the 
  7000.  command-line editor will treat the open parenthesis as the first character of 
  7001.  the filename to be completed. 
  7002.  
  7003.  
  7004. ΓòÉΓòÉΓòÉ 14.30. EXIT - Exit 4OS2 ΓòÉΓòÉΓòÉ
  7005.  
  7006.  Purpose:    Return from 4OS2. 
  7007.  
  7008.  Format:     EXIT [value ] 
  7009.  
  7010.              value :  The exit code to return (0 - 255). 
  7011.  
  7012.  Usage 
  7013.  
  7014.  EXIT terminates the current copy of 4OS2.  Use it to return to an application 
  7015.  when you have "shelled out" to work at the prompt, or to end an OS/2 
  7016.  command-line session. 
  7017.  
  7018.  To close the session, or to return to the application that started 4OS2, type: 
  7019.  
  7020.           [c:\] exit
  7021.  
  7022.  If you specify a value, EXIT will return that value to the program that 
  7023.  started 4OS2.  For example: 
  7024.  
  7025.           [c:\] exit 255
  7026.  
  7027.  The value is a number you can use to inform the program of some result, such 
  7028.  as the success or failure of a batch file.  This feature is most useful for 
  7029.  systems which use batch files to automate their operation, such as bulletin 
  7030.  boards, or custom application programs like databases that shell to 4OS2 to 
  7031.  perform certain tasks. 
  7032.  
  7033.  
  7034. ΓòÉΓòÉΓòÉ 14.31. FFIND - Search for files ΓòÉΓòÉΓòÉ
  7035.  
  7036.  Purpose:    Search for files by name or contents. 
  7037.  
  7038.  Format:     FFIND [/A:[[-]rhsda] /B /C /D[list] /E /K /L /M 
  7039.              /O[[:][-]acdeginrsu] /P /S /T"xx" /V /X["xx xx ..."] file... 
  7040.  
  7041.              list :  A list of disk drive letters (without colons). 
  7042.              file :  The file, directory, or list of files or directories to 
  7043.              display. 
  7044.  
  7045.              /A(ttribute select)             /M (no footers) 
  7046.              /B(are)                         /O(rder) 
  7047.              /C(ase sensitive)               /P(ause) 
  7048.              /D(rive)                        /S(ubdirectories) 
  7049.              /E (upper case display)         /T(ext search string) 
  7050.              /K (no headers)                 /V(erbose) 
  7051.              /L(ine numbers)                 /X (hex display/search string) 
  7052.  
  7053.  File Selection 
  7054.  
  7055.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  7056.  
  7057.  Usage 
  7058.  
  7059.  FFIND is a flexible search command that looks for files based on their names 
  7060.  and their contents. Depending on the options you choose, FFIND can display 
  7061.  filenames, matching text, or a combination of both in a variety of formats. 
  7062.  
  7063.  If you want to search for files by name, FFIND works much like the DIR 
  7064.  command.  For example, to generate a list of all the .BTM files in the current 
  7065.  directory, you could use the command: 
  7066.  
  7067.           [c:\] ffind *.btm
  7068.  
  7069.  The output from this command is a list of full pathnames, followed by the 
  7070.  number of files found. 
  7071.  
  7072.  If you want to limit the output to a list of *.BTM files which contain the 
  7073.  string color, you could use this command instead: 
  7074.  
  7075.           [c:\] ffind /t"color" *.btm
  7076.  
  7077.  The output from this version of FFIND is a list of files that contain the 
  7078.  string color along with the first line in each file that contains that string. 
  7079.  By default, FFIND uses a case-insensitve search, so the command above will 
  7080.  include files that contain COLOR, Color, color, or any other combination of 
  7081.  upper-case and lower-case letters. 
  7082.  
  7083.  You can use extended wildcards in the search string to increase the 
  7084.  flexibility of FFIND's search.  For example, the following command will find 
  7085.  .TXT files which contain either the string June or July.  It will also find 
  7086.  Juny and Jule.  The /C option makes the search case-sensitive: 
  7087.  
  7088.           [c:\] ffind /c/t"Ju[nl][ey]" *.txt
  7089.  
  7090.  At times, you may need to search for data that cannot be represented by ASCII 
  7091.  characters.  You can use FFIND's /X option to represent the search string in 
  7092.  hexadecimal format.  With /X, the search must be represented by pairs of 
  7093.  hexadecimal digits separated by spaces; a search of this type is always 
  7094.  case-sensitive (41 63 65 is the hex code for "Ace"): 
  7095.  
  7096.           [c:\] ffind /x"41 63 65" *.txt
  7097.  
  7098.  You can use FFIND's other options to further specify the files for which you 
  7099.  are searching and to modify the way in which the output is displayed. 
  7100.  
  7101.  Options 
  7102.  
  7103.     /A:     (Attribute select) Select only those files that have the specified 
  7104.             attribute(s) set.  Preceding the attribute character with a hyphen 
  7105.             [-] will select files that do not have that attribute set.  The 
  7106.             colon [:] after /A is required.  The attributes are: 
  7107.  
  7108.                            R  Read-only 
  7109.                            H  Hidden 
  7110.                            S  System 
  7111.                            D  Subdirectory 
  7112.                            A  Archive 
  7113.  
  7114.             If no attributes are listed at all (e.g., FFIND /A: ...), FFIND 
  7115.             will select all files and subdirectories including hidden and 
  7116.             system files.  If attributes are combined, all the specified 
  7117.             attributes must match for a file to be selected. For example, 
  7118.             /A:RHS will select only those files with all three attributes set. 
  7119.  
  7120.     /B:     (Bare) Display file names only and omit the text that matches the 
  7121.             search.  This option is only useful in combination with /T or /X, 
  7122.             which normally force FFIND to display file names and matching text. 
  7123.  
  7124.     /C:     (Case sensitive) Perform a case-sensitive search.  This option is 
  7125.             only valid with /T, which defaults to a case-insensitive search. 
  7126.             It is not needed with a /X hexadecimal search, which is always 
  7127.             case-sensitive. 
  7128.  
  7129.     /D:     (Drive)  Search all files on one or more drives.  If you use /D 
  7130.             without a list of drives, FFIND will search the drives specified in 
  7131.             the list of files.  If no drive letters are listed, FFIND will 
  7132.             search the default drive.  You can include a list of drives or a 
  7133.             range of drives to search as part of the /D option.  For example, 
  7134.             to search drives C:, D:, E:, and G:, you can use either of these 
  7135.             commands: 
  7136.  
  7137.                                 [c:\] ffind /dcdeg ...
  7138.                                 [c:\] ffind /dc-eg ...
  7139.  
  7140.     /E:     Display filenames in the traditional upper case; also see SETDOS /U 
  7141.             and the UpperCase directive in 4OS2.INI. 
  7142.  
  7143.     /K:     (No headers) Suppress the display of the header or filename for 
  7144.             each matching text line. 
  7145.  
  7146.     /L:     (Line numbers) Include the line number for each text line 
  7147.             displayed. 
  7148.  
  7149.     /M:     (No footers) Suppress the footer (the number of files and number of 
  7150.             matches) at the end of FFIND's display. 
  7151.  
  7152.     /O:     (Order) Set the sorting order.  You may use any combination of the 
  7153.             following sorting options; if multiple options are used, the 
  7154.             listing will be sorted with the first sort option as the primary 
  7155.             key, the next as the secondary key, and so on: 
  7156.  
  7157.               -  Reverse the sort order for the next option 
  7158.  
  7159.               a  Sort in ASCII order, not numerically, when there are digits in 
  7160.             the name 
  7161.  
  7162.               d  Sort by date and time (oldest first); for HPFS drives also see 
  7163.             /T 
  7164.  
  7165.               e  Sort by extension 
  7166.  
  7167.               g  Group subdirectories first, then files 
  7168.  
  7169.               i  Sort by file description (ignored if /C or /O:c is used) 
  7170.  
  7171.               n  Sort by filename (this is the default) 
  7172.  
  7173.               r  Reverse the sort order for all options 
  7174.  
  7175.               s  Sort by size 
  7176.  
  7177.               u  Unsorted 
  7178.  
  7179.     /P:     (Pause) Wait for a key to be pressed after each screen page before 
  7180.             continuing the display.  Your options at the prompt are explained 
  7181.             in detail under Page and File Prompts. 
  7182.  
  7183.     /S:     (Subdirectories) Display matches from the current directory and all 
  7184.             of its subdirectories. 
  7185.  
  7186.     /T:     (Text search) Specify the text search string.  /T must be followed 
  7187.             by a text string in double quotes (e.g., /t"color").  FFIND will 
  7188.             perform a case-insensitive search unless you also use the /C 
  7189.             option.  For a hexadecimal search and/or hexadecimal display of the 
  7190.             location where the search string is found, see /X.   You can 
  7191.             specify a search string with either /T or /X, but not both. 
  7192.  
  7193.     /V:     (Verbose) Show every matching line.  FFIND's default behavior is to 
  7194.             show only the first matching line then and then go on to the next 
  7195.             file.  This option is only valid with /T or /X. 
  7196.  
  7197.     /X:     (Hexadecimal display / search) Specify hexadecimal display and an 
  7198.             optional hexadecimal search string. 
  7199.  
  7200.             If /X is followed by one or more pairs of hexadecimal digits in 
  7201.             quotes (e.g., /x"44 63 65"), FFIND will search for that exact 
  7202.             sequence of characters or data bytes without regard to the meaning 
  7203.             of those bytes as text.  If those bytes are found, the offset is 
  7204.             displayed (also in hexadecimal).  A search of this type will always 
  7205.             be case-sensitive. 
  7206.  
  7207.             If /X is not followed by a hexadecimal search string it must be 
  7208.             used in conjunction with /T, and will change the output format to 
  7209.             display hexadecimal offsets rather than actual text lines when the 
  7210.             search string is found.  For example, this command uses /T to 
  7211.             display the first line in each BTM file containing the word hello: 
  7212.  
  7213.                                 [c:\] ffind /t"hello" *.btm
  7214.                                 ---- c:\test.btm:
  7215.                                 echo hello
  7216.  
  7217.                                 1 line in 1 file
  7218.  
  7219.             If you use the same command with /X, the hexadecimal offset is 
  7220.             displayed instead of the text: 
  7221.  
  7222.                                 [c:\] ffind /t"hello" /x *.btm
  7223.                                 ---- c:\test.btm:
  7224.                                 Offset: 1A
  7225.  
  7226.                                 1 line in 1 file
  7227.  
  7228.             You can specify a search string with either /T or /X, but not both. 
  7229.  
  7230.  
  7231. ΓòÉΓòÉΓòÉ 14.32. FOR - Repeat a command ΓòÉΓòÉΓòÉ
  7232.  
  7233.  Purpose:    Repeat a command for several values of a variable. 
  7234.  
  7235.  Format:     FOR [/A:[[-]rhsda] /H] %var IN ([@]set ) [DO] command ... 
  7236.  
  7237.              %var :  The variable to be used in the command ("FOR variable"). 
  7238.              set :  A set of values for the variable. 
  7239.              command :  A command or group of commands to be executed for each 
  7240.              value of the variable. 
  7241.  
  7242.              /A(ttribute select)             /H(ide dots) 
  7243.  
  7244.  File Selection 
  7245.  
  7246.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  7247.  Date, time, or size ranges must appear immediately after the FOR keyword. 
  7248.  
  7249.  Usage 
  7250.  
  7251.  FOR begins by creating a set.  It then executes a command for every member of 
  7252.  the set.  The command can be an internal command, an alias, an external 
  7253.  command, or a batch file. 
  7254.  
  7255.  Normally, the set is a list of files specified with wildcards.  For example, 
  7256.  if you use this line in a batch file: 
  7257.  
  7258.           for %x in (*.txt) do list %x
  7259.  
  7260.  then LIST will be executed once for each file in the current directory with 
  7261.  the extension .TXT.  The FOR variable %x is set equal to each of the file 
  7262.  names in turn, then the LIST command is executed for each file.  (You could do 
  7263.  the same thing more easily with a simple LIST *.TXT.  We used FOR here so you 
  7264.  could get a feel for how it operates, using a simple example.) 
  7265.  
  7266.  The set can include multiple files or an include list, like this: 
  7267.  
  7268.           for %x in (d:\*.txt;*.doc;*.asc) do type %x
  7269.  
  7270.  If the set includes filenames, the file list can be further refined by using 
  7271.  date, time, and size ranges.  The range must be placed immediately after the 
  7272.  word FOR.  The range will be ignored if no wildcards are used inside the 
  7273.  parentheses.  For example, this set is made up of all of the *.TXT files that 
  7274.  were created or updated on October 4, 1994: 
  7275.  
  7276.           for /[d10-4-94,+0] %x in (*.txt) do ...
  7277.  
  7278.  If the command is an internal command that supports ranges, an independent 
  7279.  range can also be used in the command itself. 
  7280.  
  7281.  The set can also be made up of text instead of file names.  For example, to 
  7282.  display the free space on drives C:, D:, and E:, you could use: 
  7283.  
  7284.           for %drive in (c d e) do free %drive:
  7285.  
  7286.  When the set is made up of text or several separate file names (not an include 
  7287.  list), the elements must be separated by spaces, tabs, commas, or the switch 
  7288.  character (normally a slash [/]). 
  7289.  
  7290.  You can also set the FOR variable equal to each line in a file by placing an 
  7291.  [@] in front of the file name.  If you have a file called DRIVES.TXT that 
  7292.  contains a list of drives on your computer, one drive name per line (with a 
  7293.  ":" after each drive letter), you can print the free space on each drive this 
  7294.  way: 
  7295.  
  7296.           for %d in (@drives.txt) do free %d > prn
  7297.  
  7298.  Because the [@] is also a valid filename character, FOR first checks to see if 
  7299.  the file exists with the [@] in its name (i.e., a file named @DRIVES.TXT ). 
  7300.  If so, the filename is treated as a normal argument.  If it doesn't exist, FOR 
  7301.  uses the filename (without the [@]) as the file from which to retrieve text. 
  7302.  
  7303.  You can use FOR to process the output of a command by using a Redirection and 
  7304.  Piping. To do so, use @CON as the file name.  For example, this command 
  7305.  creates a list of the names of all .MSG files in date/time order, then calls 
  7306.  the MSGPROC batch file for each file: 
  7307.  
  7308.           dir /b /od *.msg | for %fn in (@con) do call msgproc %fn
  7309.  
  7310.  You can use either % or %% in front of the variable name. Either form will 
  7311.  work, whether the FOR command is typed from the command line or is part of an 
  7312.  alias or batch file (some of the traditional command processors require a 
  7313.  single % if FOR is used at the command line, but use %% if it is used in a 
  7314.  batch file).  The variable name can be up to 80 characters long.  The word DO 
  7315.  is optional. 
  7316.  
  7317.  If you use a single-character FOR variable name, that name is given priority 
  7318.  over any environment variable which starts with the same letter, in order to 
  7319.  maintain compatibility with the traditional FOR command.  For example, the 
  7320.  following command tries to add a: and b: to the end of the PATH, but will not 
  7321.  work as intended: 
  7322.  
  7323.           [c:\] for %p in (a: b:) do path %path;%p
  7324.  
  7325.  The "%p" in "%path" will be interpreted as the FOR variable %p followed by the 
  7326.  text "ath", which is not what was intended.  To get around this, use a 
  7327.  different letter or a longer name for the FOR variable, or use square brackets 
  7328.  around the variable name (see Environment). 
  7329.  
  7330.  The following example uses FOR with variable functions to delete the .BAK 
  7331.  files for which a corresponding .TXT file exists in the current directory: 
  7332.  
  7333.           [c:\docs] for %file in (*.txt) do del %@name[%file].bak
  7334.  
  7335.  You can use command grouping to execute multiple commands for each element in 
  7336.  the list.  For example, the following command copies each .WKQ file in the 
  7337.  current directory to the D:\WKSAVE directory, then changes the extension of 
  7338.  each file in the current directory to .SAV.  This should be entered on one 
  7339.  line: 
  7340.  
  7341.           [c:\text] for %file in (*.wkq) do (copy %file d:\wksave\ &
  7342.                     ren %file *.sav)
  7343.  
  7344.  In a batch file you can use GOSUB to execute a subroutine for every element in 
  7345.  the set.  Within the subroutine, the FOR variable can be used just like any 
  7346.  environment variable.  This is a convenient way to execute a complex sequence 
  7347.  of commands for every element in the set without CALLing another batch file. 
  7348.  
  7349.  One unusual use of FOR is to execute a collection of batch files or other 
  7350.  commands with the same parameter.  For example, you might want to have three 
  7351.  batch files all operate on the same data file. The FOR command could look like 
  7352.  this: 
  7353.  
  7354.           [c:\] for %cmd in (filetest fileform fileprnt) do %cmd datafile
  7355.  
  7356.  This line will expand to three separate commands: 
  7357.  
  7358.           filetest datafile
  7359.           fileform datafile
  7360.           fileprnt datafile
  7361.  
  7362.  The variable that FOR uses (the %CMD in the example above) is created in the 
  7363.  environment and then erased when the FOR command is done.  However, for 
  7364.  compatibility with CMD.EXE, single-character FOR variables do not overwrite 
  7365.  existing environment variables with the same name.  As a result, when using a 
  7366.  multi-character variable name you must be careful not to use the name of one 
  7367.  of your environment variables as a FOR variable.  For example, a command that 
  7368.  begins 
  7369.  
  7370.           [c:\] for %path in ...
  7371.  
  7372.  will write over your current path setting and then erase the path variable 
  7373.  completely. 
  7374.  
  7375.  FOR statements can be nested. 
  7376.  
  7377.  Options 
  7378.  
  7379.     /A:     (Attribute select) Select only those files that have the specified 
  7380.             attribute(s) set.  /A will be used only when processing wildcard 
  7381.             file names in the set.  It will be ignored for filenames without 
  7382.             wildcards or other items in the set.  Preceding the attribute 
  7383.             character with a hyphen [-] will select files that do not have that 
  7384.             attribute set.  The colon [:] after /A is required.  The attributes 
  7385.             are: 
  7386.  
  7387.               R  Read-only 
  7388.               H  Hidden 
  7389.               S  System 
  7390.               D  Subdirectory 
  7391.               A  Archive 
  7392.  
  7393.             If no attributes are listed (e.g., FOR /A: ...), FOR will process 
  7394.             all files including hidden and system files.  If attributes are 
  7395.             combined, all the specified attributes must match for a file to be 
  7396.             included.  For example, /A:RHS will include only those files with 
  7397.             all three attributes set. 
  7398.  
  7399.             For example, to process only those files with the archive attribute 
  7400.             set: 
  7401.  
  7402.                                 for /a:a %f in (*.*) echo %f needs a backup!
  7403.  
  7404.     /H:     (Hide dots) Suppress the assignment of the "." and ".." directories 
  7405.             to "var". 
  7406.  
  7407.  
  7408. ΓòÉΓòÉΓòÉ 14.33. FREE - Display total and free disk space ΓòÉΓòÉΓòÉ
  7409.  
  7410.  Purpose:    Display the total disk space, total bytes used, and total bytes 
  7411.              free on the specified (or default) drive(s). 
  7412.  
  7413.  Format:     FREE [drive: ... ] 
  7414.  
  7415.              drive :  One or more drives to include in the report. 
  7416.  
  7417.  See also:  MEMORY. 
  7418.  
  7419.  Usage 
  7420.  
  7421.  FREE provides the same disk information as the external command CHKDSK, but 
  7422.  without the wait, since it does not check the integrity of the file and 
  7423.  directory structure of the disk. 
  7424.  
  7425.  A colon [:] is required after each drive letter.  This example displays the 
  7426.  status of drives A and C: 
  7427.  
  7428.           [c:\] free a: c:
  7429.  
  7430.  
  7431. ΓòÉΓòÉΓòÉ 14.34. GLOBAL - Execute a command all subdirectories ΓòÉΓòÉΓòÉ
  7432.  
  7433.  Purpose:    Execute a command in the current directory and its subdirectories. 
  7434.  
  7435.  Format:     GLOBAL [/H /I /P /Q] command 
  7436.  
  7437.              command :  The command to execute, including arguments and 
  7438.              switches. 
  7439.  
  7440.              /H(idden directories)           /P(rompt) 
  7441.              /I(gnore exit codes)            /Q(uiet) 
  7442.  
  7443.  Usage 
  7444.  
  7445.  GLOBAL performs the command first in the current directory and then in every 
  7446.  subdirectory under the current directory.  The command can be an internal 
  7447.  command, an alias, an external command, or a batch file. 
  7448.  
  7449.  This example copies the files in every directory on drive A to the directory 
  7450.  C:\TEMP : 
  7451.  
  7452.           [a:\] global copy *.* c:\temp
  7453.  
  7454.  If you use the /P option, GLOBAL will prompt for each subdirectory before 
  7455.  performing the command.  You can use this option if you want to perform the 
  7456.  command in most, but not all subdirectories of the current directory. 
  7457.  
  7458.  You can use command grouping to execute multiple commands in each 
  7459.  subdirectory.  For example, the following command copies each .TXT file in the 
  7460.  current directory and all of its subdirectories to drive A.  It then changes 
  7461.  the extension of each of the copied files to .SAV : 
  7462.  
  7463.           [c:\] global (copy *.txt a: & ren *.txt *.sav)
  7464.  
  7465.  Options 
  7466.  
  7467.     /H:     (Hidden directories) Forces GLOBAL to look for hidden directories. 
  7468.             If you don't use this switch, hidden directories are ignored. 
  7469.  
  7470.     /I:     (Ignore exit codes) If this option is not specified, GLOBAL will 
  7471.             terminate if the command returns a non- zero exit code.  Use /I if 
  7472.             you want command to continue in additional subdirectories even if 
  7473.             it returns an error in a previous subdirectory.  Even if you use 
  7474.             /I, GLOBAL will halt execution in response to Ctrl-C or Ctrl-Break. 
  7475.  
  7476.     /P:     (Prompt) Forces GLOBAL to prompt with each directory name before it 
  7477.             performs the command.  Your options at the prompt are explained in 
  7478.             detail under Page and File Prompts. 
  7479.  
  7480.     /Q:     (Quiet) Do not display the directory names as each directory is 
  7481.             processed. 
  7482.  
  7483.  
  7484. ΓòÉΓòÉΓòÉ 14.35. GOSUB - Execute a subroutine in a batch file ΓòÉΓòÉΓòÉ
  7485.  
  7486.  Purpose:    Execute a subroutine in the current batch file. 
  7487.  
  7488.  Format:     GOSUB label 
  7489.  
  7490.              label :  The batch file label at the beginning of the subroutine. 
  7491.  
  7492.  See also:  CALL, GOTO and RETURN. 
  7493.  
  7494.  Usage 
  7495.  
  7496.  GOSUB can only be used in batch files. 
  7497.  
  7498.  4OS2 allows subroutines in batch files.  A subroutine must start with a label 
  7499.  (a colon [:] followed by a one-word label name) which appears on a line by 
  7500.  itself.  Case differences are ignored when matching labels.  The subroutine 
  7501.  must end with a RETURN statement. 
  7502.  
  7503.  The subroutine is invoked with a GOSUB command from another part of the batch 
  7504.  file.  After the RETURN, processing will continue with the command following 
  7505.  the GOSUB command.  For example, the following batch file fragment calls a 
  7506.  subroutine which displays the directory and returns: 
  7507.  
  7508.           echo Calling a subroutine
  7509.           gosub subr1
  7510.           echo Returned from the subroutine
  7511.           quit
  7512.           :subr1
  7513.           dir /a/w
  7514.           return
  7515.  
  7516.  GOSUB begins its search for the label on the next line of the batch file 
  7517.  (after the GOSUB command).  If the label is not found between the current 
  7518.  position and the end of the file, GOSUB will restart the search at the 
  7519.  beginning of the file.  If the label still is not found, the batch file is 
  7520.  terminated with the error message "Label not found." 
  7521.  
  7522.  GOSUB saves the IFF state, so IFF statements inside a subroutine won't 
  7523.  interfere with IFF statements in the part of the batch file from which the 
  7524.  subroutine was called. 
  7525.  
  7526.  Subroutines can be nested. 
  7527.  
  7528.  
  7529. ΓòÉΓòÉΓòÉ 14.36. GOTO - Branch within a batch file ΓòÉΓòÉΓòÉ
  7530.  
  7531.  Purpose:    Branch to a specified line inside the current batch file. 
  7532.  
  7533.  Format:     GOTO [/I] label 
  7534.  
  7535.              label :  The batch file label to branch to. 
  7536.  
  7537.              /I(FF and DO continue) 
  7538.  
  7539.  See also:  GOSUB. 
  7540.  
  7541.  Usage 
  7542.  
  7543.  GOTO can only be used in batch files. 
  7544.  
  7545.  After a GOTO command in a batch file, the next line to be executed will be the 
  7546.  one immediately after the label.  The label must begin with a colon [:] and 
  7547.  appear on a line by itself. The colon is required on the line where the label 
  7548.  is defined, but is not required in the GOTO command itself.  Case differences 
  7549.  are ignored when matching labels. 
  7550.  
  7551.  This batch file fragment checks for the existence of the file CONFIG.SYS.  If 
  7552.  the file exists, the batch file jumps to C_EXISTS and copies all the files 
  7553.  from the current directory to the root directory on A:.  Otherwise, it prints 
  7554.  an error message and exits. 
  7555.  
  7556.           if exist config.sys goto C_EXISTS
  7557.           echo CONFIG.SYS doesn't exist - exiting.
  7558.           quit
  7559.           :C_EXISTS
  7560.           copy *.* a:\
  7561.  
  7562.  GOTO begins its search for the label on the next line of the batch file (after 
  7563.  the GOTO command).  If the label is not found between the current position and 
  7564.  the end of the file, GOTO will restart the search at the beginning of the 
  7565.  file.  If the label still is not found, the batch file is terminated with the 
  7566.  error message "Label not found." 
  7567.  
  7568.  To avoid errors in the processing of nested statements and loops, GOTO cancels 
  7569.  all active IFF statements and DO / ENDDO loops unless you use /I.  This means 
  7570.  that a normal GOTO (without /I) may not branch to any label that is between an 
  7571.  IFF and the corresponding ENDIFF or between a DO and the corresponding ENDDO. 
  7572.  
  7573.  Options 
  7574.  
  7575.     /I:     (IFF and DO continue) Prevents GOTO from canceling IFF statements 
  7576.             and DO loops.  Use this option only if you are absolutely certain 
  7577.             that your GOTO command is branching entirely within any current IFF 
  7578.             statement and any active DO / ENDDO block.  Using /I under any 
  7579.             other conditions will cause an error later in your batch file. 
  7580.  
  7581.             You cannot branch into another IFF statement, another DO loop, or a 
  7582.             different IFF or DO nesting level, whether you use the /I option or 
  7583.             not.  If you do, you will eventually receive an "unknown command" 
  7584.             error (or execution of the UNKNOWN_CMD alias) on a subsequent 
  7585.             ENDDO, ELSE, ELSEIFF, or ENDIFF statement. 
  7586.  
  7587.  
  7588. ΓòÉΓòÉΓòÉ 14.37. HELP - Display help ΓòÉΓòÉΓòÉ
  7589.  
  7590.  Purpose:    Display help for internal commands, and optionally for external 
  7591.              commands. 
  7592.  
  7593.  Format:     HELP [topic ] 
  7594.  
  7595.              topic :  A help topic, internal command, or external command. 
  7596.  
  7597.  Usage 
  7598.  
  7599.  Online help is available for 4OS2.  The 4OS2 help system uses the OS/2 help 
  7600.  facility. 
  7601.  
  7602.  If you type the command HELP by itself (or press F1 when the command line is 
  7603.  empty), the table of contents is displayed.  If you type HELP plus a topic 
  7604.  name, that topic is displayed.  For example, 
  7605.  
  7606.           help copy
  7607.  
  7608.  displays information about the COPY command and its options. 
  7609.  
  7610.  
  7611. ΓòÉΓòÉΓòÉ 14.38. HISTORY - Manage the history list ΓòÉΓòÉΓòÉ
  7612.  
  7613.  Purpose:    Display, add to, clear, or read the history list. 
  7614.  
  7615.  Format:     HISTORY [/A command /F /P /R filename ] 
  7616.  
  7617.              /A(dd)                          /P(ause) 
  7618.              /F(ree)                         /R(ead) 
  7619.  
  7620.  See also:  LOG. 
  7621.  
  7622.  Usage 
  7623.  
  7624.  4OS2 keeps a list of the commands you have entered on the command line.  See 
  7625.  Command History and Recall for additional details. 
  7626.  
  7627.  The HISTORY command lets you view and manipulate the command history list 
  7628.  directly.  If no parameters are entered, HISTORY will display the current 
  7629.  command history list: 
  7630.  
  7631.           [c:\] history
  7632.  
  7633.  With the options explained below, you can clear the list, add new commands to 
  7634.  the list without executing them, save the list in a file, or read a new list 
  7635.  from a file. 
  7636.  
  7637.  The number of commands saved in the history list depends on the length of each 
  7638.  command line.  The history list size can be specified at startup from 256 to 
  7639.  32767 characters (see the History directive).  The default size is 1024 
  7640.  characters. 
  7641.  
  7642.  Your history list can be stored either locally (a separate history list for 
  7643.  each copy of 4OS2) or globally (all copies of 4OS2 share the same list).  For 
  7644.  full details see the discussion of local and global history lists under 
  7645.  Command History and Recall. 
  7646.  
  7647.  You can use the HISTORY command as an aid in writing batch files by 
  7648.  redirecting the HISTORY output to a file and then editing the file 
  7649.  appropriately.  However, it is easier to use the LOG /H command for this 
  7650.  purpose. 
  7651.  
  7652.  You can disable the history list or specify a minimum command-line length to 
  7653.  save with the HistMin directive in the .INI file. 
  7654.  
  7655.  Options 
  7656.  
  7657.     /A:     (Add) Add a command to the history list.  This performs the same 
  7658.             function as the Ctrl-K key at the command line (see Command History 
  7659.             and Recall). 
  7660.  
  7661.     /F:     (Free) Erase all entries in the command history list. 
  7662.  
  7663.     /P:     (Prompt) Wait for a key after displaying each page of the list. 
  7664.             Your options at the prompt are explained in detail under Page and 
  7665.             File Prompts. 
  7666.  
  7667.     /R:     (Read) Read the command history from the specified file and append 
  7668.             it to the history list currently held in memory.  Each line in the 
  7669.             file must fit within the command-line length limit). 
  7670.  
  7671.             You can save the history list by redirecting the output of HISTORY 
  7672.             to a file.  This example saves the command history to a file called 
  7673.             HISTFILE and reads it back again immediately.  If you leave out the 
  7674.             HISTORY /F command on the second line, the contents of the file 
  7675.             will be appended to the current history list instead of replacing 
  7676.             it: 
  7677.  
  7678.                                 [c:\] history > histfile
  7679.                                 [c:\] history /f
  7680.                                 [c:\] history /r histfile
  7681.  
  7682.             If you need to save your history at the end of each day's work, you 
  7683.             might use commands like this in your AUTOEXEC.BAT or other startup 
  7684.             file: 
  7685.  
  7686.                                 if exist c:\histfile history /r c:\histfile
  7687.                                 alias shut*down `history > c:\histfile`
  7688.  
  7689.             This restores the previous history list if it exists, then defines 
  7690.             an alias which will save the history before shutting off the 
  7691.             system. 
  7692.  
  7693.             If you are creating a HISTORY /R file by hand, and need to create 
  7694.             an entry that spans multiple lines in the file, you can do so by 
  7695.             terminating each line, except the last, with an escape character. 
  7696.             However, you cannot use this method to exceed the command-line 
  7697.             length limit. 
  7698.  
  7699.  
  7700. ΓòÉΓòÉΓòÉ 14.39. IF - Execute a command if a condition is true ΓòÉΓòÉΓòÉ
  7701.  
  7702.  Purpose:    Execute a command if a condition or set of conditions is true. 
  7703.  
  7704.  Format:     IF [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] 
  7705.              command 
  7706.  
  7707.              condition :  A test to determine if the command should be 
  7708.              executed. 
  7709.              command :  The command to execute if the condition is true. 
  7710.  
  7711.  See also:  IFF, @IF. 
  7712.  
  7713.  Usage 
  7714.  
  7715.  IF is normally used only in aliases and batch files.  It is always followed by 
  7716.  one or more conditions and then a command. First, the conditions are 
  7717.  evaluated.  If they are true, the command is executed.  Otherwise, the command 
  7718.  is ignored. If you add a NOT before a condition, the command is executed only 
  7719.  when the condition is false. 
  7720.  
  7721.  You can link conditions with .AND., .OR., or .XOR., and you can nest IF 
  7722.  statements.  The conditions can test strings, numbers, the existence of a file 
  7723.  or subdirectory, the exit code returned by the preceding external command, and 
  7724.  the existence of alias names and internal commands. 
  7725.  
  7726.  The command can be an alias, an internal command, an external command, or a 
  7727.  batch file.  The entire IF statement, including all conditions and the 
  7728.  command, must fit on one line. 
  7729.  
  7730.  You can use command grouping to execute multiple commands if the condition is 
  7731.  true.  For example, the following command tests if any .TXT files exist.  If 
  7732.  they do, they are copied to drive A: and their extensions are changed to .TXO 
  7733.  : 
  7734.  
  7735.           if exist *.txt (copy *.txt a: & ren *.txt *.txo)
  7736.  
  7737.  (Note that the IFF command provides a more structured method of executing 
  7738.  multiple commands if a condition or set of conditions is true.) 
  7739.  
  7740.  Conditions 
  7741.  
  7742.  The following conditional tests are available in both the IF and IFF commands. 
  7743.  They fit into two categories:  string and numeric tests, and status tests. 
  7744.  The tests can use environment variables, internal variables and variable 
  7745.  functions, file names, literal text, and numeric values as their arguments. 
  7746.  
  7747.  Spaces are required on either side of the test condition in all cases, except 
  7748.  == which will work with or without spaces around it. 
  7749.  
  7750.  String and Numeric Tests 
  7751.  
  7752.  Six test conditions can be used to test character strings.  The same 
  7753.  conditions are available for both numeric and normal text strings (see below 
  7754.  for details).  In each case you enter the test as: 
  7755.  
  7756.           string1 operator string2
  7757.  
  7758.  The operator defines the type of test (equal, greater than or equal, and so 
  7759.  on).  The operators are: 
  7760.  
  7761.         EQ or ==    string1 equal to string2 
  7762.         NE or !=    string1 not equal to string2 
  7763.         LT          string1 less than string2 
  7764.         LE          string1 less than or equal to string2 
  7765.         GE          string1 greater than or equal to string2 
  7766.         GT          string1 greater than string2 
  7767.  
  7768.  Status Tests 
  7769.  
  7770.  These conditions test the system or command processor status.  You can use 
  7771.  internal variables and variable functions to test many other parts of the 
  7772.  system status. 
  7773.  
  7774.     ERRORLEVEL [operator] n
  7775.         This test retrieves the exit code of the preceding external program. 
  7776.         By convention, programs return an exit code of 0 when they are 
  7777.         successful and a number between 1 and 255 to indicate an error.  The 
  7778.         condition can be any of the operators listed above (EQ, !=, GT, etc.). 
  7779.         If no operator is specified, the default is GE.  The comparison is done 
  7780.         numerically. 
  7781.  
  7782.         Not all programs return an explicit exit code.  For programs which do 
  7783.         not, the behavior of ERRORLEVEL is undefined. 
  7784.  
  7785.     EXIST filename
  7786.         If the file exists, the condition is true.  You can use wildcards in 
  7787.         the filename, in which case the condition is true if any file matching 
  7788.         the wildcard name exists. 
  7789.  
  7790.     ISALIAS aliasname
  7791.         If the name is defined as an alias, the condition is true. 
  7792.  
  7793.     ISDIR path
  7794.         If the subdirectory exists, the condition is true. 
  7795.  
  7796.     ISINTERNAL command
  7797.         If the specified command is an active internal command, the condition 
  7798.         is true.  Commands can be activated and deactivated with the SETDOS /I 
  7799.         command. 
  7800.  
  7801.  Combining Tests 
  7802.  
  7803.  You can negate the result of any test with NOT, and combine tests of any type 
  7804.  with .AND., .OR., and .XOR.  Test conditions are always scanned from left to 
  7805.  right -- there is no implied order of precedence, as there is in some 
  7806.  programming languages. 
  7807.  
  7808.  When two tests are combined with .AND., the result is true if both individual 
  7809.  tests are true.  When two tests are combined with .OR., the result is true if 
  7810.  either (or both) individual tests are true.  When two tests are combined with 
  7811.  .XOR., the result is true only if one of the tests is true and the other is 
  7812.  false. 
  7813.  
  7814.  This example runs a program called HIGHRES if either an EGA or VGA video 
  7815.  adapter is in use: 
  7816.  
  7817.           if "%_video" == "EGA" .or. "%_video" == "VGA" highres
  7818.  
  7819.  Using the IF Tests 
  7820.  
  7821.  When IF compares two character strings, it will use either a numeric 
  7822.  comparison or a string comparison.  A numeric comparison treats the strings as 
  7823.  numeric values and tests them arithmetically.  A string comparison treats the 
  7824.  strings as text. 
  7825.  
  7826.  The difference between numeric and string comparisons is best explained by 
  7827.  looking at the way two values are tested.  For example, consider comparing the 
  7828.  values 2 and 19.  Numerically, 2 is smaller, but as a string it is "larger" 
  7829.  because its first digit is larger than the first digit of 19.  So the first of 
  7830.  these condition s will be true, and the second will be false: 
  7831.  
  7832.           if 2 lt 19 ...
  7833.           if "2" lt "19" ...
  7834.  
  7835.  IF determines which kind of test to do by examining the first character of 
  7836.  each string.  If both strings begin with a numeric character (a digit, sign, 
  7837.  or decimal point), a numeric comparison is used.  If either value does not 
  7838.  begin with a numeric character, a string comparison is used.  To force a 
  7839.  string comparison when both values are or may be numeric, use double quotes 
  7840.  around the values you are testing, as shown above.  Because the double quote 
  7841.  is not a numeric character, it forces IF to do a string comparison. 
  7842.  
  7843.  Case differences are ignored in string comparisons.  If two strings begin with 
  7844.  the same text but one is shorter, the shorter string is considered to be "less 
  7845.  than" the longer one.  For example, "a" is less than "abc", and "hello_there" 
  7846.  is greater than "hello". 
  7847.  
  7848.  When you compare text strings, you should always enclose the arguments in 
  7849.  double quotes in order to avoid syntax errors which may occur if one of the 
  7850.  argument values is empty. 
  7851.  
  7852.  Numeric comparisons work with both integer and decimal values.  The values to 
  7853.  be compared must contain only numeric digits, decimal points, and an optional 
  7854.  sign (+ or -). The number of digits to the left of the decimal point may not 
  7855.  exceed 16; if it does, an error message will be displayed.  The number of 
  7856.  digits to the right of the decimal point may not exceed 8; if it does, 
  7857.  additional digits beyond 8 will be ignored. 
  7858.  
  7859.  Internal variables and variable functions are very powerful when combined with 
  7860.  string and numeric comparisons.  They allow you to test the state of your 
  7861.  system, the characteristics of a file, date and time information, or the 
  7862.  result of a calculation.  You may want to review the variables and variable 
  7863.  functions when determining the best way to set up an IF test. 
  7864.  
  7865.  This first example is a batch file fragment which runs a program called 
  7866.  MONOPROG if a monochrome monitor is attached to the system: 
  7867.  
  7868.           if "%_monitor" == "mono" monoprog
  7869.  
  7870.  The second batch file fragment tests for a string value: 
  7871.  
  7872.           input "Enter your selection : " %%cmd
  7873.           if "%cmd" == "WP" goto wordproc
  7874.           if "%cmd" NE "GRAPHICS" goto badentry
  7875.  
  7876.  This example calls GO.BTM if the first two characters in the file MYFILE are 
  7877.  "GO": 
  7878.  
  7879.           if "%@instr[0,2,%@line[myfile,0]]"=="GO" call go.btm
  7880.  
  7881.  This batch file fragment tests for the existence of A:\JAN.DOC before copying 
  7882.  it to drive C. 
  7883.  
  7884.           if exist a:\jan.doc copy a:\jan.doc c:\
  7885.  
  7886.  This example tests the exit code of the previous program and stops all batch 
  7887.  file processing if an error occurred: 
  7888.  
  7889.           if errorlevel==0 goto success
  7890.           echo "External Error -- Batch File Ends!"
  7891.           cancel
  7892.  
  7893.  
  7894. ΓòÉΓòÉΓòÉ 14.40. IFF - IF / THEN / ELSE conditional command execution ΓòÉΓòÉΓòÉ
  7895.  
  7896.  Purpose:    Perform IF / THEN / ELSE conditional execution of commands. 
  7897.  
  7898.  Format:     IFF [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] 
  7899.              THEN & commands 
  7900.              [ELSEIFF condition  THEN & commands ] ... 
  7901.              [ELSE & commands ] 
  7902.              & ENDIFF 
  7903.  
  7904.              condition :  A test to determine if the command(s) should be 
  7905.              executed. 
  7906.              commands :  One or more commands to execute if the condition(s) is 
  7907.              true.  If you use multiple commands, they must be separated by 
  7908.              command separators or be placed on separate lines of a batch file. 
  7909.  
  7910.  See also:  IF. 
  7911.  
  7912.  Usage 
  7913.  
  7914.  IFF is similar to the IF command, except that it can perform one set of 
  7915.  commands when a condition or set of conditions is true and different commands 
  7916.  when the conditions are false. 
  7917.  
  7918.  IFF can execute multiple commands when the conditions are true or false; IF 
  7919.  normally executes only one command.  IFF imposes no limit on the number of 
  7920.  commands and is generally a "cleaner" and more structured command than IF. 
  7921.  
  7922.  IFF is always followed by one or more conditions.  If they are true, the 
  7923.  commands that follow the word THEN are executed. Additional conditions can be 
  7924.  tested with ELSEIFF.  If none of these conditions are true, the commands that 
  7925.  follow the word ELSE are executed.  In both cases, after the selected commands 
  7926.  are executed, processing continues after the word ENDIFF. 
  7927.  
  7928.  If you add a NOT before the condition, the THEN commands are executed only 
  7929.  when the condition is false and the ELSE commands are executed only when the 
  7930.  condition is true. 
  7931.  
  7932.  The commands may be separated by command separators, or may be on separate 
  7933.  lines of a batch file.  You should include a command separator or a line break 
  7934.  after a THEN, before an ELSEIFF, and before and after an ELSE. 
  7935.  
  7936.  You can link conditions with .AND., .OR., or .XOR., and you can nest IFF 
  7937.  statements up to 15 levels deep.  The conditions can test strings or numbers, 
  7938.  the existence of a file or subdirectory, the errorlevel returned from the 
  7939.  preceding external command, and the existence of alias names and internal 
  7940.  commands. 
  7941.  
  7942.  See the IF command for a list of the possible conditions. 
  7943.  
  7944.  The commands can include any internal command, alias, external command, or 
  7945.  batch file. 
  7946.  
  7947.  The following batch file fragment tests the monitor type (monochrome or 
  7948.  color), and sets the appropriate colors and prompt (enter the "prompt" lines 
  7949.  on one line of the batch file): 
  7950.  
  7951.           iff "%_monitor" == "color" then
  7952.              color bright white on blue & cls
  7953.              prompt=$e[s$e[1;1f$e[41;1;37m$e[K  Path: $p$e[u$e[44;37m$n$g
  7954.           else
  7955.              prompt=$e[s$e[1;1f$e[0;7m$e[K  Path: $p$e[u$e[0m$n$g
  7956.           endiff
  7957.  
  7958.  The alias in this second example checks to see if the argument is a 
  7959.  subdirectory.  If so, the alias deletes the subdirectory's files and removes 
  7960.  it (enter this on one line): 
  7961.  
  7962.           [c:\] alias prune `iff isdir %1 then & del /sxz %1
  7963.                 & else & echo Not a directory! & endiff`
  7964.  
  7965.  Be sure to read the cautionary notes about GOTO and IFF under the GOTO command 
  7966.  before using a GOTO inside an IFF statement. 
  7967.  
  7968.  
  7969. ΓòÉΓòÉΓòÉ 14.41. INKEY - Get a character from the keyboard ΓòÉΓòÉΓòÉ
  7970.  
  7971.  Purpose:    Get a single keystroke from the user and store it in an 
  7972.              environment variable. 
  7973.  
  7974.  Format:     INKEY [/C /D /K"keys" /P /Wn /X] [prompt ] %%varname 
  7975.  
  7976.              prompt :  Optional text that is displayed as a prompt. 
  7977.              varname :  The variable that will hold the user's keystroke. 
  7978.  
  7979.              /C(lear buffer)                 /P(assword) 
  7980.              /D(igits only)                  /W(ait) 
  7981.              /K(valid keystrokes)            /X (no carriage return) 
  7982.  
  7983.  See also:  INPUT. 
  7984.  
  7985.  Usage 
  7986.  
  7987.  INKEY optionally displays a prompt.  Then it waits for a specified time or 
  7988.  indefinitely for a keystroke, and places the keystroke into an environment 
  7989.  variable.  It is normally used in batch files and aliases to get a menu choice 
  7990.  or other single-key input.  Along with the INPUT command, INKEY allows great 
  7991.  flexibility in reading input from within a batch file or alias. 
  7992.  
  7993.  If prompt text is included in an INKEY command, it is displayed while INKEY 
  7994.  waits for input. 
  7995.  
  7996.  The following batch file fragment prompts for a character and stores it in the 
  7997.  variable NUM : 
  7998.  
  7999.           inkey Enter a number from 1 to 9:  %%num
  8000.  
  8001.  INKEY reads standard input for the keystroke, so it will accept keystrokes 
  8002.  from a redirected file.  You can supply a list of valid keystrokes with the /K 
  8003.  option. 
  8004.  
  8005.  Standard keystrokes with ASCII values between 1 and 255 are stored directly in 
  8006.  the environment variable.  Extended keystrokes (for example, function keys and 
  8007.  cursor keys) are stored as a string in decimal format, with a leading @ (for 
  8008.  example, the F1 key is @59).  The Enter key is stored as an extended 
  8009.  keystroke, with the code @28.  See the Reference Tables for a list of the 
  8010.  ASCII and extended key codes. 
  8011.  
  8012.  If you press Ctrl-C or Ctrl-Break while INKEY is waiting for a key, execution 
  8013.  of an alias will be terminated, and execution of a batch file will be 
  8014.  suspended while you are asked whether to cancel the batch jobIn a batch file 
  8015.  you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  8016.  
  8017.  Options 
  8018.  
  8019.     /C:     (Clear buffer) Clears the keyboard buffer before INKEY accepts 
  8020.             keystrokes.  If you use this option, INKEY will ignore any 
  8021.             keystrokes which you type, either accidentally or intentionally, 
  8022.             before INKEY is ready to accept input. 
  8023.  
  8024.     /D:     (Digits only) Prevents INKEY from accepting any keystroke except a 
  8025.             digit from 0 to 9. 
  8026.  
  8027.     /K["keys"]:Specify the permissible keystrokes.  The list of valid 
  8028.             keystrokes should be enclosed in double quotes.  For alphabetic 
  8029.             keys the validity test is not case sensitive.  You can specify 
  8030.             extended keys by enclosing their names in square brackets (within 
  8031.             the quotes), for example: 
  8032.  
  8033.                                 inkey /k"ab[Alt-F10]" Enter A, B, Alt-F10 %%var
  8034.  
  8035.             See Keys and Key Names for a complete listing of the key names you 
  8036.             can use within the square brackets, and a description of the key 
  8037.             name format. 
  8038.  
  8039.             If an invalid keystroke is entered, 4OS2 will echo the keystroke if 
  8040.             possible, beep, move the cursor back one character, and wait for 
  8041.             another keystroke. 
  8042.  
  8043.     /P:     (Password) Prevents INKEY from echoing the character. 
  8044.  
  8045.     /W:     (Wait) Timeout period, in seconds, to wait for a response. If no 
  8046.             keystroke is entered by the end of the timeout period, INKEY 
  8047.             returns with the variable unchanged. You can specify /W0 to return 
  8048.             immediately if there are no keys waiting in the keyboard buffer. 
  8049.  
  8050.     /X:     (No carriage return) Prevents INKEY from displaying a carriage 
  8051.             return and line feed after the user's entry. 
  8052.  
  8053.             For example, the following batch file fragment waits up to 10 
  8054.             seconds for a character, then tests to see if a "Y" was entered: 
  8055.  
  8056.                                 set net=N
  8057.                                 inkey /K"YN" /w10 Load network (Y/N)?  %%net
  8058.                                 iff "%net" == "Y" then
  8059.                                 rem Commands to load the network go here
  8060.                                 endiff
  8061.  
  8062.  
  8063. ΓòÉΓòÉΓòÉ 14.42. INPUT - Get a string from the keyboard ΓòÉΓòÉΓòÉ
  8064.  
  8065.  Purpose:    Get a string from the keyboard and save it in an environment 
  8066.              variable. 
  8067.  
  8068.  Format:     INPUT [/C /D /E /Ln /N /P /Wn /X] [prompt ] %%varname 
  8069.  
  8070.              prompt :  Optional text that is displayed as a prompt. 
  8071.              varname :  The variable that will hold the user's input. 
  8072.  
  8073.              /C(lear buffer)                 /N(o colors) 
  8074.              /D(igits only)                  /P(assword) 
  8075.              /E(dit)                         /W(ait) 
  8076.              /L(ength)                       /X (no carriage return) 
  8077.  
  8078.  See also:  INKEY. 
  8079.  
  8080.  Usage 
  8081.  
  8082.  INPUT optionally displays a prompt.  Then it waits for a specified time or 
  8083.  indefinitely for your entry.  It places any characters you type into an 
  8084.  environment variable.  INPUT is normally used in batch files and aliases to 
  8085.  get multi-key input.  Along with the INKEY command, INPUT allows great 
  8086.  flexibility in reading user input from within a batch file or alias. 
  8087.  
  8088.  If prompt text is included in an INPUT command, it is displayed while INPUT 
  8089.  waits for input.  Standard command-line editing keys may be used to edit the 
  8090.  input string as it is entered.  If you use the /P password option, INPUT will 
  8091.  echo asterisks instead of the keys you type. 
  8092.  
  8093.  All characters entered up to, but not including, the carriage return are 
  8094.  stored in the variable. 
  8095.  
  8096.  The following batch file fragment prompts for a string and stores it in the 
  8097.  variable FNAME: 
  8098.  
  8099.           input Enter the file name:  %%fname
  8100.  
  8101.  INPUT reads standard input, so it will accept text from a re- directed file. 
  8102.  
  8103.  If you press Ctrl-C or Ctrl-Break while INPUT is waiting for input, execution 
  8104.  of an alias will be terminated, and execution of a batch file will be 
  8105.  suspended while you are asked whether to cancel the batch job.  In a batch 
  8106.  file you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  8107.  
  8108.  Options 
  8109.  
  8110.     /C:     (Clear buffer) Clears the keyboard buffer before INPUT accepts 
  8111.             keystrokes.  If you use this option, INPUT will ignore any 
  8112.             keystrokes which you type, either accidentally or intentionally, 
  8113.             before INPUT is ready. 
  8114.  
  8115.     /D:     (Digits only) Prevents INKEY from accepting any keystroke except a 
  8116.             digit from 0 to 9. 
  8117.  
  8118.     /E:     (Edit) Allows you to edit an existing value.  If there is no 
  8119.             existing value for varname, INPUT proceeds as if /E had not been 
  8120.             used, and allows you to enter a new value. 
  8121.  
  8122.     /Ln:    (Length) Sets the maximum number of characters which INPUT will 
  8123.             accept to "n".  If you attempt to enter more than this number of 
  8124.             characters, INPUT will beep and prevent further input (you will 
  8125.             still be able to edit the characters typed before the limit was 
  8126.             reached). 
  8127.  
  8128.     /N:     (No colors) Disables the use of input colors defined in the 
  8129.             InputColors directive in 4OS2.INI, and forces INPUT to use the 
  8130.             default display colors. 
  8131.  
  8132.     /P:     (Password) Tells INPUT to echo asterisks, instead of the characters 
  8133.             you type. 
  8134.  
  8135.     /W:     (Wait) Timeout period, in seconds, to wait for a response. If no 
  8136.             keystroke is entered by the end of the timeout period, INPUT 
  8137.             returns with the variable unchanged. If you enter a key before the 
  8138.             timeout period, INPUT will wait indefinitely for the remainder of 
  8139.             the line.  You can specify /W0 to return immediately if there are 
  8140.             no keys waiting in the keyboard buffer. 
  8141.  
  8142.     /X:     (No carriage return) Prevents INPUT from displaying a carriage 
  8143.             return and line feed after the user's entry. 
  8144.  
  8145.  
  8146. ΓòÉΓòÉΓòÉ 14.43. KEYBD - Set the keyboard toggles ΓòÉΓòÉΓòÉ
  8147.  
  8148.  Purpose:    Set the state of the keyboard toggles:  Caps Lock, Num Lock, and 
  8149.              Scroll Lock. 
  8150.  
  8151.  Format:     KEYBD [/Cn /Nn /Sn] 
  8152.  
  8153.              n :  0 to turn off the toggle, or 1 to turn on the toggle. 
  8154.  
  8155.              /C(aps lock)                    /S(croll lock) 
  8156.              /N(um lock) 
  8157.  
  8158.  Usage 
  8159.  
  8160.  Most keyboards have 3 toggle keys, the Caps Lock, Num Lock, and Scroll Lock. 
  8161.  The toggle key status is usually displayed by three lights at the top right 
  8162.  corner of the keyboard. 
  8163.  
  8164.  This command lets you turn any toggle key on or off.  It is most useful in 
  8165.  batch files and aliases if you want the keys set a particular way before 
  8166.  collecting input from the user. 
  8167.  
  8168.  For example, to turn off the Num Lock and Caps Lock keys, you can use this 
  8169.  command: 
  8170.  
  8171.           [c:\] keybd /c0 /n0
  8172.  
  8173.  If you use the KEYBD command with no switches, it will display the present 
  8174.  state of the toggle keys. 
  8175.  
  8176.  In OS/2, the toggle key state is different for each session. Changes made with 
  8177.  KEYBD will affect the session in which the command is executed, but will not 
  8178.  affect other sessions. 
  8179.  
  8180.  Options 
  8181.  
  8182.     /C:     (Caps lock) Turn the Caps Lock key on or off. 
  8183.  
  8184.     /N:     (Num lock) Turn the Num Lock key on or off. 
  8185.  
  8186.     /S:     (Scroll lock) Turn the Scroll Lock key on or off. 
  8187.  
  8188.  
  8189. ΓòÉΓòÉΓòÉ 14.44. KEYS - Enable or disable the history list ΓòÉΓòÉΓòÉ
  8190.  
  8191.  Purpose:    Enable, disable, or display the history list. 
  8192.  
  8193.  Format:     KEYS [ON | OFF | LIST] 
  8194.  
  8195.  See also:  HISTORY. 
  8196.  
  8197.  Usage 
  8198.  
  8199.  This command is provided for compatibility with KEYS command in CMD.EXE, which 
  8200.  controls the history list in OS/2. The same functions are available by setting 
  8201.  the HistMin directive in the .INI file, and by using the HISTORY command. 
  8202.  
  8203.  The history list collects the commands you type for later recall, editing, and 
  8204.  viewing.  You can view the contents of the list through the history list 
  8205.  window or by typing any of the following commands: 
  8206.  
  8207.           [c:\] history
  8208.           [c:\] history /p
  8209.           [c:\] keys list
  8210.  
  8211.  The first command displays the entire history list.  The second displays the 
  8212.  entire list and pauses at the end of each full screen. The third command 
  8213.  produces the same output as the first, except that each line is numbered. 
  8214.  
  8215.  You can disable the collection and storage of commands in the history list by 
  8216.  typing: 
  8217.  
  8218.           [c:\] keys off
  8219.  
  8220.  You can turn the history back on with the command: 
  8221.  
  8222.           [c:\] keys on
  8223.  
  8224.  If you issue the KEYS command without any parameters, 4OS2 will show you the 
  8225.  current status of the history list. 
  8226.  
  8227.  KEYS also affects the way 4OS2 reads input from the keyboard.  KEYS OFF will 
  8228.  force 4OS2 into line input mode; KEYS ON will return input to the usual 
  8229.  character by character method.  See the LineInput directive, or the /L option 
  8230.  of the SETDOS command, for details on line input mode. 
  8231.  
  8232.  
  8233. ΓòÉΓòÉΓòÉ 14.45. LIST - Display a file ΓòÉΓòÉΓòÉ
  8234.  
  8235.  Purpose:    Display a file, with forward and backward paging and scrolling. 
  8236.  
  8237.  Format:     LIST [/A:[[-]rhsda] /H /S /W /X] file... 
  8238.  
  8239.              file :  A file or list of files to display. 
  8240.  
  8241.              /A:(ttribute select)            /W(rap) 
  8242.              /H(igh bit off)                 /X (heX display mode) 
  8243.              /S(tandard input) 
  8244.  
  8245.  See also:  TYPE. 
  8246.  
  8247.  File Selection 
  8248.  
  8249.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  8250.  
  8251.  Usage 
  8252.  
  8253.  LIST provides a much faster and more flexible way to view a file than TYPE, 
  8254.  without the overhead of loading and using a text editor. 
  8255.  
  8256.  LIST is most often used for displaying ASCII text files.  Most other files 
  8257.  contain non-alphabetic characters and may be unreadable, except in hex mode. 
  8258.  
  8259.  For example, to display a file called MEMO.DOC : 
  8260.  
  8261.           [c:\] list memo.doc
  8262.  
  8263.  If the file argument is a directory name, LIST will display all files in the 
  8264.  directory. 
  8265.  
  8266.  LIST uses the cursor pad to scroll through the file.  The following keys have 
  8267.  special meanings: 
  8268.  
  8269.         Space       Display the next page of the file (same as PgDn). 
  8270.         Home        Display the first page of the file. 
  8271.         End         Display the last page of the file. 
  8272.         Esc         Exit the current file. 
  8273.         Ctrl-C      Quit LIST. 
  8274.                    Scroll up one line. 
  8275.                    Scroll down one line. 
  8276.                    Scroll left 8 columns. 
  8277.                    Scroll right 8 columns. 
  8278.         Ctrl       Scroll left 40 columns. 
  8279.         Ctrl       Scroll right 40 columns. 
  8280.         F1          Display online help 
  8281.         B           Go back one file to the previous file in the current group 
  8282.                     of files. 
  8283.         F           Prompt and search for a string. 
  8284.         G           Go to a specific line, or, in hex mode, to a specific 
  8285.                     hexadecimal offset. 
  8286.         H           Toggle the "strip high bit" (/H) option. 
  8287.         I           Display information on the current file (the full name, 
  8288.                     size, date, and time). 
  8289.         N           Find next matching string. 
  8290.         P           Print the current page or the entire file. 
  8291.         W           Toggle the "line wrap" (/W) option. 
  8292.         X           Toggle the hex-mode display (/X) option. 
  8293.  
  8294.  Text searches performed with F and N are not case sensitive.  However, if the 
  8295.  display is currently in hexadecimal mode and you press F, you will be prompted 
  8296.  for whether you want to search in hexadecimal as well.  If you answer Y, you 
  8297.  should then enter the search string as a sequence of 2-digit hexadecimal 
  8298.  numbers separated by spaces, for example 41 63 65 (these are the ASCII values 
  8299.  for the string "Ace"; see ASCII for a complete list of ASCII codes). 
  8300.  Hexadecimal searches are case sensitive, and search for exactly the string you 
  8301.  enter. 
  8302.  
  8303.  You can use wildcards in the search string.  For example, you can search for 
  8304.  the string "to*day" to find the next line which contains the word "to" 
  8305.  followed by the word "day" later on the same line, or search for the numbers 
  8306.  "101" or "401" with the search string "[14]01". 
  8307.  
  8308.  LIST saves the search string used by F and N, so you can LIST multiple files 
  8309.  and search for the same string simply by pressing N in each file, or repeat 
  8310.  your search the next time you use LIST. 
  8311.  
  8312.  LIST normally allows long lines in the file to extend past the right edge of 
  8313.  the screen.  You can use the horizontal scrolling keys (see above) to view 
  8314.  text that extends beyond the screen width.  If you use the W command or /W 
  8315.  switch to wrap the display, each line is wrapped when it reaches the right 
  8316.  edge of the screen, and the horizontal scrolling keys are disabled. 
  8317.  
  8318.  You can use G to go to a specific line or hexadecimal offset. When prompted 
  8319.  for a line number you can enter a negative number to go backward a specified 
  8320.  number of lines from the current position (there is no corresponding option to 
  8321.  go forward a certain number of lines).  When you use this option the number of 
  8322.  lines moved will only correspond to the line count in the status bar if the 
  8323.  display is not wrapped. 
  8324.  
  8325.  If you print the file which LIST is displaying, the print format will match 
  8326.  the display format.  If you have switched to hexadecimal or wrapped mode, that 
  8327.  mode will be used for the printed output as well.  If you print in wrapped 
  8328.  mode, long lines will be wrapped at the width of the display.  If you print in 
  8329.  normal display mode without line wrap, long lines will be wrapped or truncated 
  8330.  by the printer, not by LIST. 
  8331.  
  8332.  Printed output normally goes to device LPT1.  If you wish to send the printed 
  8333.  output to another device, use the Printer directive in the .INI file. 
  8334.  
  8335.  Most of the LIST keystrokes can be reassigned with key mapping directives in 
  8336.  the .INI file . 
  8337.  
  8338.  You can set the colors used by LIST with the ListColors and ListStatBarColors 
  8339.  directives in the .INI file.  If ListColors is not used, the LIST display will 
  8340.  use the current default colors.  If ListStatBarColors is not used, the status 
  8341.  bar will use the reverse of the LIST display colors. 
  8342.  
  8343.  Options 
  8344.  
  8345.     /A:     (Attribute select) Select only those files that have the specified 
  8346.             attribute(s) set.  Preceding the attribute character with a hyphen 
  8347.             [-] will select files that do not have that attribute set.  The 
  8348.             colon [:] after /A is required.  The attributes are: 
  8349.                            R  Read-only 
  8350.                            H  Hidden 
  8351.                            S  System 
  8352.                            D  Subdirectory 
  8353.                            A  Archive 
  8354.  
  8355.             If no attributes are listed at all (e.g., LIST /A: ...), LIST will 
  8356.             select all files and subdirectories including hidden and system 
  8357.             files.  If attributes are combined, all the specified attributes 
  8358.             must match for a file to be selected. For example, /A:RHS will 
  8359.             select only those files with all three attributes set. 
  8360.     /H:     (High bit off) Strip the high bit from each character before 
  8361.             displaying.  This is useful when displaying files created by some 
  8362.             word processors that turn on the high bit for formatting purposes. 
  8363.             You can toggle this option on and off from within LIST with the H 
  8364.             key. 
  8365.  
  8366.     /S:     (Standard input) Read from standard input rather than a file.  This 
  8367.             allows you to redirect command output and view it with LIST.  For 
  8368.             example, to use LIST to display the output of DIR: 
  8369.  
  8370.                                 [c:\] dir | list /s
  8371.  
  8372.     /W:     (Wrap) Wrap the text at the right edge of the screen.  This option 
  8373.             is useful when displaying files that don't have a carriage return 
  8374.             at the end of each line.  The horizontal scrolling keys do not work 
  8375.             when the display is wrapped.  You can toggle this option on and off 
  8376.             from within LIST with the W key. 
  8377.  
  8378.     /X      (heX mode):  Display the file in hexadecimal (hex) mode. This 
  8379.             option is useful when displaying executable files and other files 
  8380.             that contain non-text characters.  Each byte of the file is shown 
  8381.             as a pair of hex characters.  The corresponding text is displayed 
  8382.             to the right of each line of hexadecimal data.  You can toggle this 
  8383.             mode on and off from within LIST with the X key. 
  8384.  
  8385.  
  8386. ΓòÉΓòÉΓòÉ 14.46. LOADBTM - Switch a batch file's mode ΓòÉΓòÉΓòÉ
  8387.  
  8388.  Purpose:    Switch a batch file to or from BTM mode. 
  8389.  
  8390.  Format:     LOADBTM [ON | OFF] 
  8391.  
  8392.  Usage 
  8393.  
  8394.  4OS2 recognizes two kinds of batch files: .BAT or .CMD, and .BTM.  Batch files 
  8395.  executing in BTM mode run two to five times faster than in BAT or CMD mode. 
  8396.  Batch files automatically start in the mode indicated by their extension. 
  8397.  
  8398.  The LOADBTM command turns BTM mode on and off.  It can be used to switch modes 
  8399.  in either a .BAT / .CMD or .BTM file.  If you use LOADBTM with no argument, it 
  8400.  will display the current batch mode:  LOADBTM ON or LOADBTM OFF. 
  8401.  
  8402.  LOADBTM can only be used within a batch file.  It is most often used to switch 
  8403.  a .BAT file into BTM mode after memory-resident programs are loaded, or to 
  8404.  convert a .BAT or .CMD file to BTM mode without changing its extension. 
  8405.  
  8406.  Using LOADBTM to repeatedly switch modes within a batch file is not efficient. 
  8407.  In most cases the speed gained by running some parts of the file in BTM mode 
  8408.  will be more than offset by the speed lost through repeated loading of the 
  8409.  file each time BTM mode is invoked. 
  8410.  
  8411.  
  8412. ΓòÉΓòÉΓòÉ 14.47. LOG - Save a log of commands ΓòÉΓòÉΓòÉ
  8413.  
  8414.  Purpose:    Save a log of commands to a disk file. 
  8415.  
  8416.  Format:     LOG [/H /W file ] [ON | OFF | text ] 
  8417.  
  8418.              file :  The name of the file to hold the log. 
  8419.              text :  An optional message that will be added to the log. 
  8420.  
  8421.              /H(istory log)                  /W(rite to). 
  8422.  
  8423.  See also:  HISTORY. 
  8424.  
  8425.  Usage 
  8426.  
  8427.  LOG keeps a record of all internal and external commands you use. Each entry 
  8428.  includes the current system date and time, along with the actual command after 
  8429.  any alias or variable expansion.  You can use the log file as a record of your 
  8430.  daily activities. 
  8431.  
  8432.  LOG with the /H option keeps a similar record, but it does not record the date 
  8433.  and time for each command.  In addition, it records commands before aliases 
  8434.  and variables are expanded. 
  8435.  
  8436.  By default, LOG writes to the file 4OS2LOG in the root directory of the boot 
  8437.  drive.  The default file name for LOG /H is 4OS2HLOG. 
  8438.  
  8439.  Entering LOG or LOG /H with no parameters displays the name of the log file 
  8440.  and the log status (ON or OFF): 
  8441.  
  8442.           [c:\] log
  8443.           LOG (C:\4OS2LOG) is OFF
  8444.  
  8445.  To enable or disable logging, add the word "ON" or "OFF" after the LOG 
  8446.  command: 
  8447.  
  8448.           [c:\] log on
  8449.  
  8450.  or 
  8451.  
  8452.           [c:\] log /h on
  8453.  
  8454.  Entering LOG or LOG /H with text writes a message to the log file, even if 
  8455.  logging  is set OFF.  This allows you to enter headers in the log file: 
  8456.  
  8457.           [c:\] log "Started work on the database system"
  8458.  
  8459.  The LOG file format looks like this: 
  8460.  
  8461.           [date  time]  command
  8462.  
  8463.  where the date and time are formatted according to the country code set for 
  8464.  your system. 
  8465.  
  8466.  The LOG /H output can be used as the basis for writing batch files. Start LOG 
  8467.  /H, then execute the commands that you want the batch file to execute.  When 
  8468.  you are finished, turn LOG /H off.  The resulting file can be turned into a 
  8469.  batch file that performs the same commands with little or no editing. 
  8470.  
  8471.  You can have both a regular log (with time and date stamping) and a history 
  8472.  log (without the time stamps) enabled simultaneously. 
  8473.  
  8474.  Options 
  8475.  
  8476.     /H:     (History log) This option turns on (or off) the history log, which 
  8477.             saves commands without the time and date stamp.  For example, to 
  8478.             turn on history logging and write to the file C:\LOG\HLOG: 
  8479.  
  8480.                                 [c:\]  log /h /w c:\log\hlog
  8481.  
  8482.     /W:     (Write) This switch specifies a different filename for the LOG or 
  8483.             LOG /H output.  It also automatically performs a LOG ON command. 
  8484.             For example, to turn logging on and write the log to C:\LOG\LOGFILE 
  8485.             : 
  8486.  
  8487.                                 [c:\] log /w c:\log\logfile
  8488.  
  8489.             Once you select a new file name with the LOG /W or LOG /H/W 
  8490.             command, LOG will use that file until you issue another LOG /W or 
  8491.             LOG /H/W command, or until you reboot your computer.  Turning LOG 
  8492.             or LOG /H off or on does not change the file name.  You can set the 
  8493.             default log file names when 4OS2 starts with the LogName and 
  8494.             HistLogName directives in the .INI file. 
  8495.  
  8496.  
  8497. ΓòÉΓòÉΓòÉ 14.48. MD - Create a subdirectory ΓòÉΓòÉΓòÉ
  8498.  
  8499.  Purpose:    Create a subdirectory. 
  8500.  
  8501.  Format:     MD [/S] pathname... 
  8502.                 or 
  8503.              MKDIR [/S] pathname... 
  8504.  
  8505.              pathname :  The name of one or more directories to create. 
  8506.  
  8507.              /S(ubdirectories) 
  8508.  
  8509.  See also:  RD. 
  8510.  
  8511.  Usage 
  8512.  
  8513.  MD and MKDIR are synonyms.  You can use either one. 
  8514.  
  8515.  MD creates a subdirectory anywhere in the directory tree.  To create a 
  8516.  subdirectory from the root, start the pathname with a backslash [\].  For 
  8517.  example, this command creates a subdirectory called MYDIR in the root 
  8518.  directory: 
  8519.  
  8520.           [c:\] md \mydir
  8521.  
  8522.  If no path is given, the new subdirectory is created in the current directory. 
  8523.  This example creates a subdirectory called DIRTWO in the current directory: 
  8524.  
  8525.           [c:\mydir] md dirtwo
  8526.  
  8527.  To create a directory from the parent of the current directory (that is, to 
  8528.  create a sibling of the current directory), start the pathname with two 
  8529.  periods and a backslash [..\]. 
  8530.  
  8531.  Option 
  8532.  
  8533.     /S:     (Subdirectories) MD creates one directory at a time unless you use 
  8534.             the /S option.  If you need to create the directory 
  8535.             C:\ONE\TWO\THREE and none of the named directories exist, you can 
  8536.             use /S to have MD create all of the necessary subdirectories for 
  8537.             you in a single command: 
  8538.  
  8539.                                 [c:\] md /s \one\two\three
  8540.  
  8541.  
  8542. ΓòÉΓòÉΓòÉ 14.49. MEMORY - Display memory statistics ΓòÉΓòÉΓòÉ
  8543.  
  8544.  Purpose:    Display the amount and status of system RAM. 
  8545.  
  8546.  Format:     MEMORY 
  8547.  
  8548.  Usage 
  8549.  
  8550.  MEMORY lists the total physical and resident RAM in your system, the largest 
  8551.  free block of RAM, the total size of your swap file, the total and free 
  8552.  environment and alias space, and the total history space.  (The first two RAM 
  8553.  size values are displayed by 4OS2/32, but not by 4OS2/16.) 
  8554.  
  8555.  If the OS/2 swap file is not stored in the \OS2\SYSTEM directory of the boot 
  8556.  drive, you must use the SwapFilePath directive in 4OS2.INI or MEMORY will not 
  8557.  be able to display the swap file size. 
  8558.  
  8559.  
  8560. ΓòÉΓòÉΓòÉ 14.50. MOVE - Move files ΓòÉΓòÉΓòÉ
  8561.  
  8562.  Purpose:    Move files to a new directory and drive. 
  8563.  
  8564.  Format:     MOVE  [/A:[[-]rhsda] /C /D /F /H /M /N /P /Q /R /S /T /U /V] 
  8565.              source...  destination 
  8566.  
  8567.              source :  A file or list of files to move. 
  8568.              destination :  The new location for the files. 
  8569.  
  8570.              /A:(ttribute select)            /P(rompt) 
  8571.              /C(hanged)                      /Q(uiet) 
  8572.              /D(irectory)                    /R(eplace) 
  8573.              /F(orce delete)                 /S(ubdirectory tree) 
  8574.              /H(idden and system)            /T(otal) 
  8575.              /M(odified files)               /U(pdate) 
  8576.              /N(othing)                      /V(erify) 
  8577.  
  8578.  See also:  COPY and RENAME. 
  8579.  
  8580.  File Selection 
  8581.  
  8582.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  8583.  Date, time, or size ranges anywhere on the line apply to all source files. 
  8584.  
  8585.  Usage 
  8586.  
  8587.  The MOVE command moves one or more files from one directory to another, 
  8588.  whether the directories are on the same drive or not.  It has the same effect 
  8589.  as copying the files to a new location and then deleting the originals.  Like 
  8590.  COPY and RENAME, MOVE works with single files, multiple files, and sets of 
  8591.  files specified with an include list. 
  8592.  
  8593.  The simplest MOVE command moves a single source file to a new location and, 
  8594.  optionally, gives it a new name.  These two examples both move one file from 
  8595.  drive C: to the root directory on drive A: 
  8596.  
  8597.           [c:\] move myfile.dat a:\
  8598.           [c:\] move myfile.dat a:\savefile.dat
  8599.  
  8600.  In both cases, MYFILE.DAT is removed from drive C: after it has been copied to 
  8601.  drive A:.  If a file called MYFILE.DAT in the first example, or SAVEFILE.DAT 
  8602.  in the second example, already existed on drive A:, it would be overwritten. 
  8603.  (This demonstrates the difference between MOVE and RENAME.  MOVE will move 
  8604.  files between drives and will overwrite the destination file if it exists; 
  8605.  RENAME will not.) 
  8606.  
  8607.  If you MOVE multiple files, the destination must be a directory name.  MOVE 
  8608.  will move each file into the destination directory with its original name (if 
  8609.  the target is not a directory, MOVE will display an error message and exit): 
  8610.  
  8611.           [c:\] move *.wks *.txt c:\finance\myfiles
  8612.  
  8613.  You cannot move a file to a character device like the printer, or to itself. 
  8614.  
  8615.  When you move files to another directory, if you add a backslash [\] to the 
  8616.  end of the destination name MOVE will display an error message if the name 
  8617.  does not refer to an existing directory. You can use this feature to keep MOVE 
  8618.  from treating a mistyped destination directory name as a file name, and 
  8619.  attempting to move all source files to that name.  The /D option performs the 
  8620.  same function but will also prompt to see if you want to create the 
  8621.  destination directory if it doesn't exist. 
  8622.  
  8623.  Be careful when you use MOVE with the SELECT command.  If you SELECT multiple 
  8624.  files and the target is not a directory (for example, because of a 
  8625.  misspelling), MOVE will assume it is a file name.  In this case each file will 
  8626.  be moved in turn to the target file, overwriting the previous file, and then 
  8627.  the original will be erased before the next file is moved.  At the end of the 
  8628.  command, all of the original files will have been erased and only the last 
  8629.  file will exist as the target file.  You can avoid this problem by using 
  8630.  square brackets with SELECT instead of parentheses (be sure that you don't 
  8631.  allow the command line to get too long -- watch the character count in the 
  8632.  upper left corner while you're selecting files).  MOVE will then receive one 
  8633.  list of files to move instead of a series of individual filenames, and it will 
  8634.  detect the error and halt.  You can also add a backslash [\] to the end of the 
  8635.  destination name to ensure that it is the name of a subdirectory (see above). 
  8636.  
  8637.  MOVE first attempts to rename the file(s), which is the fastest way to move 
  8638.  files between subdirectories on the same drive.  If that fails (the 
  8639.  destination is on a different drive or already exists), MOVE will copy the 
  8640.  file(s) and then delete the originals. 
  8641.  
  8642.  If MOVE must physically copy the files and delete the originals, rather than 
  8643.  renaming them (see above), then some disk space may be freed on the source 
  8644.  drive.  The free space may be the result of moving the files to another drive, 
  8645.  or of overwriting a larger destination file with a smaller source file.  MOVE 
  8646.  displays the amount of disk space recovered unless the /Q option is used (see 
  8647.  below).  It does so by comparing the amount of free disk space before and 
  8648.  after the MOVE command is executed.  However, this amount may be incorrect if 
  8649.  you are using a deletion tracking system which stores deleted files in a 
  8650.  hidden directory, or if, under a multitasking system, another program performs 
  8651.  a file operation while the MOVE command is executed. 
  8652.  
  8653.  When physically copying files, MOVE preserves the hidden, system, and 
  8654.  read-only attributes of the source files, and sets the archive attribute of 
  8655.  the destination files.  However, if the files can be renamed, and no copying 
  8656.  is required, then the source file attributes are not changed. 
  8657.  
  8658.  Options 
  8659.  
  8660.     /A:     (Attribute select) Select only those files that have the specified 
  8661.             attribute(s) set.  Preceding the attribute character with a hyphen 
  8662.             [-] will select files that do not have that attribute set.  The 
  8663.             colon [:] after /A is required.  The attributes are: 
  8664.  
  8665.                            R  Read-only 
  8666.                            H  Hidden 
  8667.                            S  System 
  8668.                            D  Subdirectory 
  8669.                            A  Archive 
  8670.  
  8671.             If no attributes are listed at all (e.g., MOVE /A: ...), MOVE will 
  8672.             select all files and subdirectories including hidden and system 
  8673.             files.  If attributes are combined, all the specified attributes 
  8674.             must match for a file to be selected. For example, /A:RHS will 
  8675.             select only those files with all three attributes set. 
  8676.  
  8677.     /C:     (Changed files) Move files only if the destination file exists and 
  8678.             is older than the source (see also /U).  This option is useful for 
  8679.             updating the files in one directory from those in another without 
  8680.             moving any newly-created files. 
  8681.  
  8682.     /D:     (Directory) Requires that the destination be a directory.  If the 
  8683.             destination does not exist, MOVE will prompt to see if you want to 
  8684.             create it. If the destination exists as a file, MOVE will fail with 
  8685.             an "Access denied" error.  Use this option to avoid having MOVE 
  8686.             accidentally interpret your destination name as a file name when 
  8687.             it's really a mistyped directory name. 
  8688.  
  8689.     /F:     (Force delete) This option only works in the 32-bit version of 
  8690.             4OS2.  It forces deletion of the source file without saving it to 
  8691.             the DELDIR directory (if DELDIR is not in use, /F has no effect). 
  8692.  
  8693.     /H:     (Hidden) Move all files, including hidden and system files. 
  8694.  
  8695.     /M:     (Modified files) Move only files that have the archive bit set. The 
  8696.             archive bit will remain set after the MOVE; to clear it use ATTRIB. 
  8697.  
  8698.     /N:     (Nothing) Do everything except actually move the file(s). This 
  8699.             option is most useful for testing what a complex MOVE command will 
  8700.             do. 
  8701.  
  8702.     /P:     (Prompt) Prompt the user to confirm each move.  Your options at the 
  8703.             prompt are explained in detail under Page and File Prompts. 
  8704.  
  8705.     /Q:     (Quiet) Don't display filenames, the total number of files moved, 
  8706.             or the amount of disk space recovered, if any.  This option is most 
  8707.             often used in batch files. See also /T. 
  8708.  
  8709.     /R:     (Replace) Prompt for a Y or N response before overwriting an 
  8710.             existing destination file. 
  8711.  
  8712.     /S:     (Subdirectories) Move an entire subdirectory tree to another 
  8713.             location.  MOVE will attempt to create the destination directories 
  8714.             if they don't exist, and will remove empty subdirectories after the 
  8715.             move. When /D is used with /S, you will be prompted if the first 
  8716.             destination directory does not exist, but subdirectories below that 
  8717.             will be created automatically by MOVE.  If you attempt to use /S to 
  8718.             move a subdirectory tree into part of itself, MOVE will display an 
  8719.             error message and halt. 
  8720.  
  8721.     /T:     (Total) Don't display filenames as they are moved, but display the 
  8722.             total number of files deleted and the amount of free disk space 
  8723.             recovered, if any. 
  8724.  
  8725.     /U:     (Update) Move each source file only if it is newer than a matching 
  8726.             destination file or if a matching destination file does not exist 
  8727.             (also see /C).  This option is useful for moving new or changed 
  8728.             files from one directory to another. 
  8729.  
  8730.     /V:     (Verify) Verify each disk write.  This is the same as executing the 
  8731.             VERIFY ON command, but is only active during the MOVE.  /V does not 
  8732.             read back the file and compare its contents with what was written; 
  8733.             it only verifies that the data written to disk is physically 
  8734.             readable. 
  8735.  
  8736.  
  8737. ΓòÉΓòÉΓòÉ 14.51. ON - Handle Ctrl-Break and errors in batch files ΓòÉΓòÉΓòÉ
  8738.  
  8739.  Purpose:    Execute a command in a batch file when a specific condition 
  8740.              occurs. 
  8741.  
  8742.  Format:     ON BREAK [command ] 
  8743.                 or 
  8744.              ON ERROR [command ] 
  8745.                 or 
  8746.              ON ERRORMSG [command ] 
  8747.  
  8748.  Usage 
  8749.  
  8750.  ON can only by used in batch files. 
  8751.  
  8752.  ON sets a "watchdog" that remains in effect for the duration of the current 
  8753.  batch file.  Whenever a BREAK or ERROR condition occurs after ON has been 
  8754.  executed, the command is automatically executed. 
  8755.  
  8756.  ON BREAK will execute its command if the user presses Ctrl- C or Ctrl-Break. 
  8757.  
  8758.  ON ERROR will execute its command after any command processor or operating 
  8759.  system error (including critical errors). That is, ON ERROR will detect errors 
  8760.  such as a disk write error, and 4OS2 errors such as a COPY command that fails 
  8761.  to copy any files, or the use of an unacceptable command option.  The normal 
  8762.  error message is not displayed when ON ERROR is used. 
  8763.  
  8764.  ON ERRORMSG is the same as ON ERROR, but displays the usual error message 
  8765.  before executing the command.  The additional information about ON ERROR below 
  8766.  also applies to ON ERRORMSG. 
  8767.  
  8768.  ON BREAK and ON ERROR are independent of each other.  You can use either one, 
  8769.  or both, in any batch file. 
  8770.  
  8771.  Each time ON BREAK or ON ERROR is used, it defines a new command to be 
  8772.  executed for a break or error, and any old command is discarded.  If you use 
  8773.  ON BREAK or ON ERROR with no following command, that type of error handling is 
  8774.  disabled. Error handling is also automatically disabled when the batch file 
  8775.  exits. 
  8776.  
  8777.  ON BREAK and ON ERROR only affect the current batch file.  If you CALL another 
  8778.  batch file, the first batch file's error handling is suspended, and the CALLed 
  8779.  file must define its own error handling. When control returns to the first 
  8780.  batch file, its error handling is reactivated. 
  8781.  
  8782.  The command can be any command that can be used on a batch file line by 
  8783.  itself.  Frequently, it is a GOTO or GOSUB command.  For example, the 
  8784.  following fragment traps any user attempt to end the batch file by pressing 
  8785.  Ctrl-C or Ctrl-Break.  It scolds the user for trying to end the batch file and 
  8786.  then continues displaying the numbers from 1 to 1000: 
  8787.  
  8788.           on break gosub gotabreak
  8789.           do i = 1 to 1000
  8790.              echo %i
  8791.           enddo
  8792.           quit
  8793.           :gotabreak
  8794.           echo Hey!  Stop that!!
  8795.           return
  8796.  
  8797.  You can use a command group as the command if you want to execute multiple 
  8798.  commands, for example: 
  8799.  
  8800.           on break (echo Oops, got a break! & quit)
  8801.  
  8802.  ON BREAK and ON ERROR always assume that you want to continue executing the 
  8803.  batch file.  After the command is executed, control automatically returns to 
  8804.  the next command in the batch file (the command after the one that was 
  8805.  interrupted by the break or error).  The only way to avoid continuing the 
  8806.  batch file after a break or error is for the command to transfer control to 
  8807.  another point with GOTO, end the batch file with QUIT or CANCEL, or start 
  8808.  another batch file (without CALLing it). 
  8809.  
  8810.  When handling an error condition with ON ERROR, you may find it useful to use 
  8811.  internal variables, particularly %_? and %_SYSERR, to help determine the cause 
  8812.  of the error. 
  8813.  
  8814.  Caution:  If a break or error occurs while the command specified in ON BREAK 
  8815.  or ON ERROR is executing, the command will be restarted. This means you must 
  8816.  use caution to avoid or handle any possible errors in the commands invoked by 
  8817.  ON ERROR, since such errors can cause an infinite loop. 
  8818.  
  8819.  
  8820. ΓòÉΓòÉΓòÉ 14.52. PATH - Set the executable file search path ΓòÉΓòÉΓòÉ
  8821.  
  8822.  Purpose:    Display or alter the list of directories that 4OS2 will search for 
  8823.              executable files, batch files, and files with executable 
  8824.              extensions that are not in the current directory. 
  8825.  
  8826.  Format:     PATH [directory [;directory...]] 
  8827.  
  8828.              directory :  The full name of a directory to include in the path 
  8829.              setting. 
  8830.  
  8831.  See also:  ESET and SET. 
  8832.  
  8833.  Usage 
  8834.  
  8835.  When 4OS2 is asked to execute an external command (a .COM, .EXE, .BTM, .BAT, 
  8836.  or .CMD file or executable extension), it first looks for the file in the 
  8837.  current directory. If it fails to find an executable file there, it then 
  8838.  searches each of the directories specified in the PATH setting. 
  8839.  
  8840.  For example, after the following PATH command, 4OS2 will search for an 
  8841.  executable file in four directories:  the current directory, then the root 
  8842.  directory on drive C, then the DOS subdirectory on C, and then the UTIL 
  8843.  subdirectory on C: 
  8844.  
  8845.           [c:\] path c:\;c:\dos;c:\util
  8846.  
  8847.  The list of directories to search can be set or viewed with the PATH command. 
  8848.  The list is stored as an environment string, and can also be set or viewed 
  8849.  with SET, and edited with ESET. 
  8850.  
  8851.  Directory names in the path must be separated by semicolons [;].  Each 
  8852.  directory name is shifted to upper case to maintain compatibility with 
  8853.  programs which can only recognize upper case directory names in the path.  If 
  8854.  you modify your path with the SET or ESET command, you may include directory 
  8855.  names in lower case.  These may cause trouble with some programs, which assume 
  8856.  that all path entries have been shifted to upper case. 
  8857.  
  8858.  If you enter PATH with no parameters, the current path is displayed: 
  8859.  
  8860.           [c:\] path
  8861.           PATH=C:\;C:\DOS;C:\UTIL
  8862.  
  8863.  Entering PATH and a semicolon clears the search path so that only the current 
  8864.  directory is searched for executable files (this is the default at system 
  8865.  startup). 
  8866.  
  8867.  Some applications also use the PATH to search for their data files. 
  8868.  
  8869.  If you include an explicit file extension on a command name (for example, 
  8870.  WP.EXE ), the search will find files with that name and extension in the 
  8871.  current directory and every directory in the path. It will not locate other 
  8872.  executable files with the same base name. 
  8873.  
  8874.  If you have an entry in the path which consists of a single period [.], the 
  8875.  current directory will not be searched first, but instead will be searched 
  8876.  when 4OS2 reaches the "." in the path. This allows you to delay the search of 
  8877.  the current directory for executable files and files with executable 
  8878.  extensions.  In rare cases, this feature may not be compatible with 
  8879.  applications which use the path to find their files; if you experience a 
  8880.  problem, you will have to remove the "." from the path while using any such 
  8881.  application. 
  8882.  
  8883.  To create a path longer than the command-line length limit, use PATH 
  8884.  repeatedly to append additional directories to the path: 
  8885.  
  8886.           path [first list of directories]
  8887.           path %path;[second list of directories]
  8888.           ...
  8889.  
  8890.  You cannot use this method to extend the path beyond 2042 characters (the 
  8891.  internal buffer limit, with room for "PATH ").  It is usually more efficient 
  8892.  to use aliases to load application programs than to create a long PATH.  See 
  8893.  ALIAS for details. 
  8894.  
  8895.  If you specify an invalid directory in the path, it will be skipped and the 
  8896.  search will continue with the next directory in the path. 
  8897.  
  8898.  
  8899. ΓòÉΓòÉΓòÉ 14.53. PAUSE - Suspend batch file or alias execution ΓòÉΓòÉΓòÉ
  8900.  
  8901.  Purpose:    Suspend batch file or alias execution. 
  8902.  
  8903.  Format:     PAUSE [text ] 
  8904.  
  8905.              text :  The message to be displayed as a user prompt. 
  8906.  
  8907.  Usage 
  8908.  
  8909.  A PAUSE command will suspend execution of a batch file or alias, giving you 
  8910.  the opportunity to change disks, turn on the printer, etc. 
  8911.  
  8912.  PAUSE waits for any key to be pressed and then continues execution. You can 
  8913.  specify the text that PAUSE displays while it waits for a keystroke, or let 
  8914.  4OS2 use the default message: 
  8915.  
  8916.           Press any key when ready...
  8917.  
  8918.  For example, the following batch file fragment prompts the user before erasing 
  8919.  files: 
  8920.  
  8921.           pause Press Ctrl-C to abort, any other key to erase all .LST files
  8922.           erase *.lst
  8923.  
  8924.  If you press Ctrl-C or Ctrl-Break while PAUSE is waiting for a key, execution 
  8925.  of an alias will be terminated, and execution of a batch file will be 
  8926.  suspended while you are asked whether to cancel the batch job.  In a batch 
  8927.  file you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  8928.  
  8929.  
  8930. ΓòÉΓòÉΓòÉ 14.54. POPD - Restore the disk drive and directory ΓòÉΓòÉΓòÉ
  8931.  
  8932.  Purpose:    Return to the disk drive and directory at the top of the directory 
  8933.              stack.. 
  8934.  
  8935.  Format:     POPD [*] 
  8936.  
  8937.  See also:  DIRS and PUSHD. 
  8938.  
  8939.  Usage 
  8940.  
  8941.  Each time you use the PUSHD command, it saves the current disk drive and 
  8942.  directory on the internal directory stack.  POPD restores the last drive and 
  8943.  directory that was saved with PUSHD and removes that entry from the stack. 
  8944.  You can use these commands together to change directories, perform some work, 
  8945.  and return to the starting drive and directory. 
  8946.  
  8947.  Directory changes made with POPD are recorded for display in the directory 
  8948.  history window. 
  8949.  
  8950.  This example saves and changes the current disk drive and directory with 
  8951.  PUSHD, and then restores it.  The current directory is shown in the prompt: 
  8952.  
  8953.           [c:\] pushd d:\database\test
  8954.           [d:\database\test] popd
  8955.           [c:\]
  8956.  
  8957.  You can use the DIRS command to see the complete list of saved drives and 
  8958.  directories (the directory stack). 
  8959.  
  8960.  The POPD command followed by an asterisk [*] clears the directory stack 
  8961.  without changing the current drive and directory. 
  8962.  
  8963.  If the directory on the top of the stack is not on the current drive, POPD 
  8964.  will switch to the drive and directory on the top of the stack without 
  8965.  changing the default directory on the current drive. 
  8966.  
  8967.  
  8968. ΓòÉΓòÉΓòÉ 14.55. PROMPT - Change the command-line prompt ΓòÉΓòÉΓòÉ
  8969.  
  8970.  Purpose:    Change the command-line prompt. 
  8971.  
  8972.  Format:     PROMPT [text ] 
  8973.  
  8974.              text :  Text to be used as the new command-line prompt. 
  8975.  
  8976.  Usage 
  8977.  
  8978.  You can change and customize the command-line prompt at any time. The prompt 
  8979.  can include normal text, and system information such as the current drive and 
  8980.  directory, the time and date, and the amount of memory available.  You can 
  8981.  create an informal "Hello, Bob!" prompt or an official-looking prompt full of 
  8982.  impressive information. The prompt text can contain special commands in the 
  8983.  form $?, where ? is one of the characters listed below: 
  8984.  
  8985.         b     The vertical bar character [|]. 
  8986.         c     The open parenthesis [(]. 
  8987.         d     Current date, in the format:  Fri  1-06-95 (the month, day, and 
  8988.               year are formatted according to your current country settings). 
  8989.         D     Current date, in the format:  Fri  Jan 6, 1995. 
  8990.         e     The ASCII ESC character (decimal 27). 
  8991.         f     The close parenthesis [)]. 
  8992.         g     The > character. 
  8993.         h     Backspace over the previous character. 
  8994.         i     Display the OS/2 prompt header line, which reminds you of how to 
  8995.               return to the OS/2 desktop, or get help. 
  8996.         l     The < character. 
  8997.         m     Time in hours and minutes using 24-hour format:  16:07 
  8998.         M     Time in hours and minutes using the default country format and 
  8999.               retaining "a" or "p", e.g. 4:07p. 
  9000.         n     Current drive letter. 
  9001.         p     Current directory on drive d: (including drive letter), in lower 
  9002.               case. 
  9003.         P     Current directory on drive d: (including drive letter), in upper 
  9004.               case. 
  9005.         q     The = character. 
  9006.         r     The numeric exit code of the last external command. 
  9007.         s     The space character. 
  9008.         t     Current 24-hour time, in the format hh:mm:ss. 
  9009.         T     Current 12-hour time, in the format hh:mm:ss[a|p]. 
  9010.         v     Operating system version number, in the format 3.10. 
  9011.         xd:   Current directory on drive d:, in lower case (uses the actual 
  9012.               case of the directory name as stored on the disk for HPFS 
  9013.               drives). 
  9014.         Xd:   Current directory on drive d:, in upper case. 
  9015.         z     Current shell nesting level; the primary command processor is 
  9016.               shell 0. 
  9017.         $     The $ character. 
  9018.         _     CR/LF (go to beginning of a new line). 
  9019.  
  9020.  For example, to set the prompt to the current date and time, with a ">" at the 
  9021.  end: 
  9022.  
  9023.           [c:\] prompt $d $t $g
  9024.           Fri  Dec 2, 1994 10:29:19 >
  9025.  
  9026.  To set the prompt to the current date and time, followed by the current drive 
  9027.  and directory in upper case on the next line, with a ">" at the end: 
  9028.  
  9029.           [c:\] prompt $d $t$_$P$g
  9030.           Fri  Dec 2, 1994 10:29:19
  9031.           [c:\]
  9032.  
  9033.  The 4OS2 prompt can be set in CONFIG.SYS (see below), and the prompt for any 
  9034.  command processor can be set in 4START, or in any batch file that runs when 
  9035.  4OS2 starts. 
  9036.  
  9037.  The 4OS2 default prompt is [$n] (drive name in square brackets) on floppy 
  9038.  drives, and [$p] (current drive and directory in square brackets) on all other 
  9039.  drives.  When OS/2 is installed, it inserts a SET PROMPT statement in 
  9040.  CONFIG.SYS to set the prompt to $i[$p].  This prompt will override the 4OS2 
  9041.  defaults.  The $i adds a header line to the default prompt to remind you of 
  9042.  certain OS/2 keystrokes.  You must delete this statement if you want to use 
  9043.  the default prompt. 
  9044.  
  9045.  If you enter PROMPT with no arguments, the prompt will be reset to its default 
  9046.  value.  The PROMPT command sets the environment variable PROMPT, so to view 
  9047.  the current prompt setting use the command: 
  9048.  
  9049.           [c:\] set prompt
  9050.  
  9051.  (If the prompt is not set at all, the PROMPT environment variable will not be 
  9052.  used, in which case the SET command above will give a "Not in environment" 
  9053.  error.) 
  9054.  
  9055.  Along with literal text, special characters, and ANSI sequences you can 
  9056.  include the text of any environment variable, internal variable, or variable 
  9057.  function in a prompt.  For example, if you want to include the size of the 
  9058.  largest free memory block in the command prompt, plus the current drive and 
  9059.  directory, you could use this command: 
  9060.  
  9061.           [c:\] prompt (%%@dosmem[K]K) $p$g
  9062.           (601K) [c:\data]
  9063.  
  9064.  Notice that the @DOSMEM function is shown with two leading percent signs [%]. 
  9065.  If you used only one percent sign, the @DOSMEM function would be expanded once 
  9066.  when the PROMPT command was executed, instead of every time the prompt is 
  9067.  displayed.  As a result, the amount of memory would never change from the 
  9068.  value it had when you entered the PROMPT command.  You can also use back 
  9069.  quotes to delay expanding the variable function until the prompt is displayed: 
  9070.  
  9071.           [c:\] prompt `(%@dosmem[K]K) $p$g`
  9072.  
  9073.  You can include ANSI escape sequences in the PROMPT text.  See ANSI for 
  9074.  complete details on ANSI commands.  This example uses ANSI sequences to set a 
  9075.  prompt that displays the shell level, date, time and path in color on the top 
  9076.  line of the screen (enter the command as one line): 
  9077.  
  9078.           [c:\] prompt $e[s$e[1;1f$e[41;1;37m$e[K[$z] $d
  9079.                 Time: $t$h$h$h  Path: $p$e[u$e[0;32m$n$g
  9080.  
  9081.  You may find it helpful to define a different prompt in secondary shells, 
  9082.  perhaps including $z in the prompt to display the shell level.  To do so, 
  9083.  place a PROMPT command in your 4START file and use IF or IFF statements to set 
  9084.  the appropriate prompt for different shells. 
  9085.  
  9086.  
  9087. ΓòÉΓòÉΓòÉ 14.56. PUSHD - Save the disk drive and directory ΓòÉΓòÉΓòÉ
  9088.  
  9089.  Purpose:    Save the current disk drive and directory, optionally changing to 
  9090.              a new drive and directory. 
  9091.  
  9092.  Format:     PUSHD [pathname ] 
  9093.  
  9094.              pathname :  The name of the new default drive and directory. 
  9095.  
  9096.  See also:  DIRS, POPD and the CDPATH environment variable. 
  9097.  
  9098.  Usage 
  9099.  
  9100.  PUSHD saves the current drive and directory on a "last in, first out" 
  9101.  directory stack.  The POPD command returns to the last drive and directory 
  9102.  that was saved by PUSHD.  You can use these commands together to change 
  9103.  directories, perform some work, and return to the starting drive and 
  9104.  directory.  The DIRS command displays the contents of the directory stack. 
  9105.  
  9106.  To save the current drive and directory, without changing directories, use the 
  9107.  PUSHD command by itself, with no pathname. 
  9108.  
  9109.  If a pathname is specified as part of the PUSHD command, the current drive and 
  9110.  directory are saved and PUSHD changes to the specified drive and directory. 
  9111.  If the pathname includes a drive letter, PUSHD changes to the specified 
  9112.  directory on the new drive without changing the current directory on the 
  9113.  original drive. 
  9114.  
  9115.  This example saves the current directory and changes to C:\WORDP\MEMOS, then 
  9116.  returns to the original directory: 
  9117.  
  9118.           [c:\] pushd \wordp\memos
  9119.           [c:\wordp\memos] popd
  9120.           [c:\]
  9121.  
  9122.  Directory changes made with PUSHD are recorded for display in the directory 
  9123.  history window. 
  9124.  
  9125.  The directory stack can hold up to 255 characters, or about 10 to 20 entries 
  9126.  (depending on the length of the names).  If you exceed this limit, the oldest 
  9127.  entry is removed before adding a new entry. 
  9128.  
  9129.  If PUSHD can't change directly to the specified directory, it will look for 
  9130.  the CDPATH variable; see CDPATH for details. 
  9131.  
  9132.  
  9133. ΓòÉΓòÉΓòÉ 14.57. QUIT - Terminate a batch file ΓòÉΓòÉΓòÉ
  9134.  
  9135.  Purpose:    Terminate the current batch file. 
  9136.  
  9137.  Format:     QUIT [value ] 
  9138.  
  9139.              value :  The exit code from 0 to 255 to return to 4OS2 or to the 
  9140.              previous batch file. 
  9141.  
  9142.  See also:  CANCEL. 
  9143.  
  9144.  Usage 
  9145.  
  9146.  QUIT provides a simple way to exit a batch file before reaching the end of the 
  9147.  file.  If you QUIT a batch file called from another batch file, you will be 
  9148.  returned to the previous file at the line following the original CALL. 
  9149.  
  9150.  QUIT only ends the current batch file.  To end all batch file processing, use 
  9151.  the CANCEL command. 
  9152.  
  9153.  If you specify a value, QUIT will set the ERRORLEVEL or exit code (see the IF 
  9154.  command, and the %? variable) to that value. 
  9155.  
  9156.  You can also use QUIT to terminate an alias.  If you QUIT an alias while 
  9157.  inside a batch file, QUIT will end both the alias and the batch file and 
  9158.  return you to the command prompt or to the calling batch file. 
  9159.  
  9160.  
  9161. ΓòÉΓòÉΓòÉ 14.58. RD - Remove subdirectories ΓòÉΓòÉΓòÉ
  9162.  
  9163.  Purpose:    Remove one or more subdirectories. 
  9164.  
  9165.  Format:     RD pathname... 
  9166.                 or 
  9167.              RMDIR pathname... 
  9168.  
  9169.              pathname :  The name of one or more subdirectories to remove. 
  9170.  
  9171.  See also:  MD. 
  9172.  
  9173.  File Selection 
  9174.  
  9175.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  9176.  
  9177.  Usage 
  9178.  
  9179.  RD and RMDIR are synonyms.  You can use either one. 
  9180.  
  9181.  RD removes directories from the directory tree.  For example, to remove the 
  9182.  subdirectory MEMOS from the subdirectory WP, you can use this command: 
  9183.  
  9184.           [c:\] rd \wp\memos
  9185.  
  9186.  Before using RD, you must delete all files and subdirectories (and their 
  9187.  files) in the pathname you want to remove.  Remember to remove hidden and 
  9188.  read-only files as well as normal files (you can use DEL /Z to delete hidden 
  9189.  and read-only files). 
  9190.  
  9191.  You can use wildcards in the pathname. 
  9192.  
  9193.  You cannot remove the root directory, the current directory (.), any directory 
  9194.  above the current directory in the directory tree, or any directory in use by 
  9195.  another process in a multitasking system. 
  9196.  
  9197.  
  9198. ΓòÉΓòÉΓòÉ 14.59. REBOOT - Reboot the system ΓòÉΓòÉΓòÉ
  9199.  
  9200.  Purpose:    Do a system reboot. 
  9201.  
  9202.  Format:     REBOOT [/S /V] 
  9203.  
  9204.              /S(hutdown)                     /V(erify) 
  9205.  
  9206.  Usage 
  9207.  
  9208.  REBOOT will completely restart your computer.  It normally performs a warm 
  9209.  reboot, which is comparable to pressing Ctrl-Alt-Delete. A reboot is necessary 
  9210.  to activate any changes to your CONFIG.SYS file. 
  9211.  
  9212.  The following example prompts you to verify the reboot, then does a warm boot: 
  9213.  
  9214.           [c:\] reboot /v
  9215.  
  9216.  REBOOT defaults to performing a warm boot, with no prompting. 
  9217.  
  9218.  REBOOT flushes the disk buffers, resets the drives, and waits one second 
  9219.  before rebooting, to allow disk caching programs to finish writing any cached 
  9220.  data.  4OS2 issues the proper commands to shut down OS/2 before rebooting. 
  9221.  
  9222.  REBOOT uses the DOS.SYS device driver to reboot your system.  DOS.SYS is 
  9223.  loaded via a DEVICE= statement in your CONFIG.SYS file.  If DOS.SYS is not 
  9224.  loaded, REBOOT will not work. 
  9225.  
  9226.  Options 
  9227.  
  9228.     /S:     (Shutdown) Shut down the system, but do not reboot.  This option is 
  9229.             equivalent to clicking the "Shutdown" choice on the OS/2 2.x and 
  9230.             above Workplace Shell popup menu. 
  9231.  
  9232.     /V:     (Verify) Prompt for confirmation (Y or N) before rebooting or 
  9233.             taking the action specified by other REBOOT options. 
  9234.  
  9235.  
  9236. ΓòÉΓòÉΓòÉ 14.60. REM - Put a comment in a batch file ΓòÉΓòÉΓòÉ
  9237.  
  9238.  Purpose:    Put a comment in a batch file. 
  9239.  
  9240.  Format:     REM [comment ] 
  9241.  
  9242.              comment :  The text to include in the batch file. 
  9243.  
  9244.  Usage 
  9245.  
  9246.  The REM command lets you place a remark or comment in a batch file. Batch file 
  9247.  comments are useful for documenting the purpose of a batch file and the 
  9248.  procedures you have used. 
  9249.  
  9250.  REM must be followed by a space or tab character and then your comment. 
  9251.  Comments can be up to 1023 characters long.  4OS2 will normally ignore 
  9252.  everything on the line after the REM command, including quote characters, 
  9253.  redirection symbols, and other commands (see below for the exception to this 
  9254.  rule). 
  9255.  
  9256.  If ECHO is ON, the comment is displayed.  Otherwise, it is ignored. If ECHO is 
  9257.  ON and you don't want to display the line, preface the REM command with an at 
  9258.  sign [@]. 
  9259.  
  9260.  You can use REM to create a zero-byte file if you use a redirection symbol 
  9261.  after the REM command.  No text is permitted between the REM command and the 
  9262.  redirection symbol.  For example, to create the zero-byte file C:\FOO : 
  9263.  
  9264.           [c:\] rem > foo
  9265.  
  9266.  (This capability is included for compatibility with CMD.EXE.  A simpler method 
  9267.  for creating a zero-byte file with 4OS2 is to enter  >filename as a command, 
  9268.  with no actual command before the [>] redirection character.) 
  9269.  
  9270.  
  9271. ΓòÉΓòÉΓòÉ 14.61. REN - Rename files or subdirectories ΓòÉΓòÉΓòÉ
  9272.  
  9273.  Purpose:    Rename files or subdirectories. 
  9274.  
  9275.  Format:     REN [/A:[[-]rhsda] /N /P /Q /S /T] old_name... new_name 
  9276.                 or 
  9277.              RENAME [/A:[[-]rhsda] /N /P /Q /S /T] old_name... new_name 
  9278.  
  9279.              old_name :  Original name of the file(s) or subdirectory. 
  9280.              new_name :  New name to use, or new path on the same drive. 
  9281.  
  9282.              /A:(ttribute select)            /Q(uiet) 
  9283.              /N(othing)                      /S(ubdirectory) 
  9284.              /P(rompt)                       /T(otal) 
  9285.  
  9286.  See also:  COPY and MOVE. 
  9287.  
  9288.  File Selection 
  9289.  
  9290.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  9291.  
  9292.  Usage 
  9293.  
  9294.  REN and RENAME are synonyms.  You may use either one. 
  9295.  
  9296.  REN lets you change the name of a file or a subdirectory, or move one or more 
  9297.  files to a new subdirectory on the same drive.  (If you want to move files to 
  9298.  a different drive, use MOVE.) 
  9299.  
  9300.  In its simplest form, you simply give REN the old_name of an existing file or 
  9301.  subdirectory and then a new_name.  The new_name must not already exist -- you 
  9302.  can't give two files the same name (unless they are in different directories). 
  9303.  The first example renames the file MEMO.TXT to MEM.TXT.  The second example 
  9304.  changes the name of the \WORD directory to \WP : 
  9305.  
  9306.           [c:\] rename memo.txt mem.txt
  9307.           [c:\] rename \word \wp
  9308.  
  9309.  You can also use REN to rename a group of files that you specify with 
  9310.  wildcards, as multiple files, or in an include list.  When you do, the 
  9311.  new_name must use one or more wildcards to show what part of each filename to 
  9312.  change.  Both of the next two examples change the extensions of multiple files 
  9313.  to .SAV : 
  9314.  
  9315.           [c:\] ren config.sys autoexec.bat 4start.btm *.sav
  9316.           [c:\] ren *.txt *.sav
  9317.  
  9318.  REN can move files to a different subdirectory on the same drive. When it is 
  9319.  used for this purpose, REN requires one or more filenames for the old_name and 
  9320.  a directory name for the new_name : 
  9321.  
  9322.           [c:\] ren memo.txt \wp\memos\
  9323.           [c:\] ren oct.dat nov.dat \data\save\
  9324.  
  9325.  The final backslash in the last two examples is optional.  If you use it, you 
  9326.  force REN to recognize the last argument as the name of a directory, not a 
  9327.  file.  The advantage of this approach is that if you accidentally mistype the 
  9328.  directory name, REN will report an error instead of renaming your files in a 
  9329.  way that you didn't intend. 
  9330.  
  9331.  Finally, REN can move files to a new directory and change their name at the 
  9332.  same time if you specify both a path and file name for new_name.  In this 
  9333.  example, the files are renamed with an extension of .SAV as they are moved to 
  9334.  a new directory: 
  9335.  
  9336.           [c:\] ren *.dat \data\save\*.sav
  9337.  
  9338.  When new_name refers to a file or files (rather than a directory), the file(s) 
  9339.  must not already exist.  Also, you cannot rename a subdirectory to a new 
  9340.  location on the directory tree. 
  9341.  
  9342.  REN does not change a file's attributes.  The new_name file(s) will have the 
  9343.  same attributes as old_name. 
  9344.  
  9345.  Options 
  9346.  
  9347.     /A:     (Attribute select) Select only those files that have the specified 
  9348.             attribute(s) set.  Preceding the attribute character with a hyphen 
  9349.             [-] will select files that do not have that attribute set.  The 
  9350.             colon [:] after /A is required.  The attributes are: 
  9351.  
  9352.                            R  Read-only 
  9353.                            H  Hidden 
  9354.                            S  System 
  9355.                            D  Subdirectory 
  9356.                            A  Archive 
  9357.  
  9358.             If no attributes are listed at all (e.g., REN /A: ...), REN will 
  9359.             select all files and subdirectories including hidden and system 
  9360.             files.  If attributes are combined, all the specified attributes 
  9361.             must match for a file to be selected. For example, /A:RHS will 
  9362.             select only those files with all three attributes set. 
  9363.  
  9364.     /N:     (Nothing) Do everything except actually rename the file(s). This 
  9365.             option is useful for testing what a REN command will actually do. 
  9366.  
  9367.     /P:     (Prompt) Prompt the user to confirm each rename operation. Your 
  9368.             options at the prompt are explained in detail under Page and File 
  9369.             Prompts. 
  9370.  
  9371.     /Q:     (Quiet) Don't display filenames  or the number of files renamed. 
  9372.             This option is most often used in batch files.  See also /T. 
  9373.  
  9374.     /S:     (Subdirectory) Normally, you can rename a subdirectory only if you 
  9375.             do not use any wildcards in the new_name.  This prevents 
  9376.             subdirectories from being renamed inadvertently when a group of 
  9377.             files is being renamed with wildcards.  /S will let you rename a 
  9378.             subdirectory even when you use wildcards. 
  9379.  
  9380.     /T:     (Total) Don't display filenames as they are renamed, but report the 
  9381.             number of files renamed.  See also /Q. 
  9382.  
  9383.  
  9384. ΓòÉΓòÉΓòÉ 14.62. RETURN - Return from a subroutine in a batch file ΓòÉΓòÉΓòÉ
  9385.  
  9386.  Purpose:    Return from a GOSUB (subroutine) in a batch file. 
  9387.  
  9388.  Format:     RETURN 
  9389.  
  9390.  See also:  GOSUB. 
  9391.  
  9392.  Usage 
  9393.  
  9394.  4OS2 allows subroutines in batch files. 
  9395.  
  9396.  A subroutine begins with a label (a colon followed by a word) and ends with a 
  9397.  RETURN command. 
  9398.  
  9399.  The subroutine is invoked with a GOSUB command from another part of the batch 
  9400.  file.  When a RETURN command is encountered the subroutine terminates, and 
  9401.  execution of the batch file continues on the line following the original 
  9402.  GOSUB. 
  9403.  
  9404.  The following batch file fragment calls a subroutine which displays the files 
  9405.  in the current directory: 
  9406.  
  9407.           echo Calling a subroutine
  9408.           gosub subr1
  9409.           echo Returned from the subroutine
  9410.           quit
  9411.  
  9412.           :subr1
  9413.           dir /a/w
  9414.           return
  9415.  
  9416.  
  9417. ΓòÉΓòÉΓòÉ 14.63. SCREEN - Position the cursor and display text ΓòÉΓòÉΓòÉ
  9418.  
  9419.  Purpose:    Position the cursor on the screen and optionally display a 
  9420.              message. 
  9421.  
  9422.  Format:     SCREEN row column [text ] 
  9423.  
  9424.              row :  The new row location for the cursor. 
  9425.              column :  The new column location for the cursor. 
  9426.              text :  Optional text to display at the new cursor location. 
  9427.  
  9428.  See also:  ECHO, SCRPUT, TEXT, and VSCRPUT. 
  9429.  
  9430.  Usage 
  9431.  
  9432.  SCREEN allows you to create attractive screen displays in batch files.  You 
  9433.  use it to specify where a message will appear on the screen.  You can use 
  9434.  SCREEN to create menu displays, logos, etc. The following batch file fragment 
  9435.  displays a menu: 
  9436.  
  9437.           @echo off
  9438.           cls
  9439.           screen 3 10  Select a number from 1 to 4:
  9440.           screen 6 20  1 - Word Processing
  9441.           ...
  9442.  
  9443.  SCREEN does not change the screen colors.  To display text in specific colors, 
  9444.  use SCRPUT or VSCRPUT.  SCREEN always leaves the cursor at the end of the 
  9445.  displayed text. 
  9446.  
  9447.  The row and column values are zero-based, so on a standard 25 line by 80 
  9448.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can 
  9449.  also specify the row and column as offsets from the current cursor position. 
  9450.  Begin the value with a plus sign [+] to move the cursor down the specified 
  9451.  number of rows or to the right the specified number of columns, or with a 
  9452.  minus sign [-] to move the cursor up or to the left.  This example prints a 
  9453.  string 3 lines above the current position, in absolute column 10: 
  9454.  
  9455.           screen -3 10 Hello, World!
  9456.  
  9457.  SCREEN checks for a valid row and column, and displays a "Usage" error message 
  9458.  if either value is out of range. 
  9459.  
  9460.  
  9461. ΓòÉΓòÉΓòÉ 14.64. SCRPUT - Display text in color ΓòÉΓòÉΓòÉ
  9462.  
  9463.  Purpose:    Position text on the screen and display it in color. 
  9464.  
  9465.  Format:     SCRPUT row col [BRIght] [BLInk] fg ON [BRIght] bg text 
  9466.  
  9467.              row :  Starting row 
  9468.              col :  Starting column 
  9469.              fg :  Foreground character color 
  9470.              bg :  Background character color 
  9471.              text :  The text to display 
  9472.  
  9473.  See also:  CLS, ECHO, SCREEN, TEXT, and VSCRPUT. 
  9474.  
  9475.  Usage 
  9476.  
  9477.  SCRPUT allows you to create attractive screen displays in batch files.  You 
  9478.  use it to specify where a message will appear on the screen and what colors 
  9479.  will be used to display the message text. You can use SCRPUT to create menu 
  9480.  displays, logos, etc. 
  9481.  
  9482.  SCRPUT works like SCREEN, but allows you to specify the display colors.  It 
  9483.  writes directly to the screen and does not require ANSI support.  It always 
  9484.  leaves the cursor in its current position.  See Colors and Color Names for 
  9485.  details about colors and notes on the use of bright background colors. 
  9486.  
  9487.  The row and column are zero-based, so on a standard 25 line by 80 column 
  9488.  display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can also 
  9489.  specify the row and column as offsets from the current cursor position.  Begin 
  9490.  the value with a plus sign [+] to move down the specified number of rows or to 
  9491.  the right the specified number of columns, or with a minus sign [-] to move up 
  9492.  or to the left. 
  9493.  
  9494.  The following batch file fragment displays part of a menu, in color: 
  9495.  
  9496.           cls white on blue
  9497.           scrput 6 20 bri red on blu 1 - Word Processing
  9498.           scrput 7 20 bri yel on blu 2 - Spreadsheet
  9499.           ...
  9500.  
  9501.  
  9502. ΓòÉΓòÉΓòÉ 14.65. SELECT - Select files for a command ΓòÉΓòÉΓòÉ
  9503.  
  9504.  Purpose:    Interactively select files for a command. 
  9505.  
  9506.  Format:     SELECT [/A[:][-][rhsda] /D /E /H /I"text" /O[:][-]adeginrsu /Z] 
  9507.              [command ] ... (files...)... 
  9508.  
  9509.              command :  The command to execute with the selected files. 
  9510.              files :  The files from which to select.  File names may be 
  9511.              enclosed in either parentheses or square brackets.  The difference 
  9512.              is explained below. 
  9513.  
  9514.              /A(ttribute select)             /I (match descriptions) 
  9515.              /D(isable color coding)         /O(rder) 
  9516.              /E (use upper case)             /Z (use FAT format) 
  9517.              /H(ide dots) 
  9518.  
  9519.  File Selection 
  9520.  
  9521.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  9522.  Date, time, or size ranges must appear immediately after the SELECT keyword. 
  9523.  
  9524.  Usage 
  9525.  
  9526.  SELECT allows you to select files for internal and external commands by using 
  9527.  a full-screen "point and shoot" display.  You can have SELECT execute a 
  9528.  command once for each file you select, or have it create a list of files for a 
  9529.  command to work with.  The command can be an internal command, an alias, an 
  9530.  external command, or a batch file. 
  9531.  
  9532.  If you use parentheses around the files, SELECT executes the command once for 
  9533.  each file you have selected.  During each execution, one of the selected files 
  9534.  is passed to the command as an argument.  If you use square brackets around 
  9535.  files, the SELECTed files are combined into a single list, separated by 
  9536.  spaces.  The command is then executed once with the entire list presented as 
  9537.  its command-line arguments. 
  9538.  
  9539.  SELECT uses the cursor up, cursor down, PgUp, and PgDn keys to scroll through 
  9540.  the file list.  Use the + key or the spacebar to select a file (or deselect a 
  9541.  marked file), and the - key to deselect a file.  The * key will reverse all of 
  9542.  the current marks (excluding subdirectories), and the / key will unmark 
  9543.  everything.  After marking the files, press Enter to execute the command. 
  9544.  
  9545.  Press the L key to view the current highlighted file with LIST.  When you exit 
  9546.  from LIST, the SELECT screen will be restored. 
  9547.  
  9548.  You can select a single file by moving the scroll bar to the filename and 
  9549.  pressing Enter without marking any other files. 
  9550.  
  9551.  To skip the files listed in the current display and go on to the next file 
  9552.  specification inside the parentheses or brackets (if any), press the Esc key. 
  9553.  To cancel the current SELECT command entirely, press Ctrl-C or Ctrl-Break. 
  9554.  
  9555.  On HPFS drives, SELECT will use the standard long name display format with the 
  9556.  filename at the right-hand side of the display.  File descriptions are not 
  9557.  displayed in this format.  To switch to the more traditional FAT (short name) 
  9558.  format, and display the file descriptions, use the /Z switch. 
  9559.  
  9560.  In the simplest form of SELECT, you merely specify the command and then the 
  9561.  list of files from which you will make your selection(s). For example: 
  9562.  
  9563.           [c:\] select copy (*.com *.exe) a:\
  9564.  
  9565.  will let you select from among the .COM and .EXE files on the current drive. 
  9566.  It will then invoke the COPY command to copy each file you select to drive A:. 
  9567.  You will be able to select first from a list of all .COM files in the current 
  9568.  directory, and then from a list of all .EXE files. 
  9569.  
  9570.  If you want to select from a list of all the .COM and .EXE files mixed 
  9571.  together, create an include list inside the parentheses by inserting a 
  9572.  semicolon: 
  9573.  
  9574.           [c:\] select copy (*.com;*.exe) a:\
  9575.  
  9576.  Finally, if you want the SELECT command to send a single list of files to 
  9577.  COPY, instead of invoking COPY once for each file you select, put the file 
  9578.  names in square brackets instead of parentheses: 
  9579.  
  9580.           [c:\] select copy [*.com;*.exe] a:\
  9581.  
  9582.  If you use brackets, you have to be sure that the resulting command (the word 
  9583.  COPY, the list of files, and the destination drive in this example) is no more 
  9584.  than 1,023 characters long.  The current line length is displayed by SELECT 
  9585.  while you are marking files to help you to conform to this limit. 
  9586.  
  9587.  The parentheses or brackets enclosing the file name(s) can appear anywhere 
  9588.  within the command; SELECT assumes that the first set of parentheses or 
  9589.  brackets it finds is the one containing the list of files from which you wish 
  9590.  to make your selection. 
  9591.  
  9592.  The list of files from which you wish to select can be further refined by 
  9593.  using date, time, and size ranges.  The range must be placed immediately after 
  9594.  the word SELECT.  If the command is an internal command that supports ranges, 
  9595.  an independent range can also be used in the command itself. 
  9596.  
  9597.  If you don't specify a command, the selected filename(s) will become the 
  9598.  command.  For example, this command defines an alias called UTILS that selects 
  9599.  from the executable files in the directory C:\UTIL, and then executes them in 
  9600.  the order marked: 
  9601.  
  9602.           [c:\] alias utils select (c:\util\*.com;*.exe;*.btm;*.bat)
  9603.  
  9604.  If you want to use filename completion to enter the filenames inside the 
  9605.  parentheses, type a space after the opening parenthesis.  Otherwise the 
  9606.  command-line editor will treat the open parenthesis as the first character of 
  9607.  the filename. 
  9608.  
  9609.  You can set the default colors used by SELECT with the SelectColors and 
  9610.  SelectStatBarColors directives in the .INI file.  If SelectColors is not used, 
  9611.  the SELECT display will use the current default colors.  If 
  9612.  SelectStatBarColors is not used, the status bar will use the reverse of the 
  9613.  SELECT display colors. 
  9614.  
  9615.  You can display the filenames in color by setting the COLORDIR environment 
  9616.  variable or using the ColorDir directive in your .INI file.  See Color-Coded 
  9617.  Directories for details.  To disable directory color coding within SELECT, use 
  9618.  the /D option. 
  9619.  
  9620.  When displaying descriptions, SELECT adds a right arrow at the end of the line 
  9621.  if the description is too long to fit on the screen.  This symbol will alert 
  9622.  you to the existence of additional description text.  You can use the left and 
  9623.  right arrow keys to scroll the screen horizontally and view the additional 
  9624.  text. 
  9625.  
  9626.  With the /I option, you can select files based on their descriptions.  SELECT 
  9627.  will display files if their description matches the text after the /I switch. 
  9628.  The search is not case sensitive.  You can use wildcards and extended wild 
  9629.  cards as part of the text. 
  9630.  
  9631.  When sorting file names and extensions for the SELECT display, 4OS2 normally 
  9632.  assumes that sequences of digits should be sorted numerically (for example, 
  9633.  the file DRAW2 would come before DRAW03 because 2 is numerically smaller than 
  9634.  03), rather than strictly alphabetically (where DRAW2 would come second 
  9635.  because "2" comes after "0").  You can defeat this behavior and force a strict 
  9636.  alphabetic sort with the /O:a option. 
  9637.  
  9638.  Options 
  9639.  
  9640.     /A:     (Attribute select) Select only those files that have the specified 
  9641.             attribute(s) set.  Preceding the attribute character with a hyphen 
  9642.             [-] will select files that do not have that attribute set.  The 
  9643.             colon [:] after /A is optional.  The attributes are: 
  9644.  
  9645.               R  Read-only 
  9646.               H  Hidden 
  9647.               S  System 
  9648.               D  Subdirectory 
  9649.               A  Archive 
  9650.  
  9651.             If no attributes are listed at all (e.g., SELECT /A ...), SELECT 
  9652.             will display all files and subdirectories including hidden and 
  9653.             system files. If attributes are combined, all the specified 
  9654.             attributes must match for a file to be included in the listing. 
  9655.             For example, /A:RHS will display only those files with all three 
  9656.             attributes set. 
  9657.  
  9658.     /D:     (Disable color coding)  Temporarily turn off directory color coding 
  9659.             within SELECT. 
  9660.  
  9661.     /E      (use upper case)  Display filenames in the traditional upper case 
  9662.             format; also see SETDOS /U and the UpperCase  directive in the .INI 
  9663.             file. 
  9664.  
  9665.     /H      (Hide dots)  Suppress the display of the "." and ".." directories 
  9666.  
  9667.     /I      (match descriptions)  Display filenames by matching text in their 
  9668.             descriptions.  The text can include wild cards and extended 
  9669.             wildcards.  The search text must be enclosed in quotation marks. 
  9670.  
  9671.     /O:     (Order)  Set the sort order for the files.  The order can be any 
  9672.             combination of the following options: 
  9673.  
  9674.               -  Reverse the sort order for the next option 
  9675.               a  Sort in ASCII order, not numerically, when there are digits in 
  9676.             the name 
  9677.               d  Sort by date and time (oldest first); for HPFS drives also see 
  9678.             /T 
  9679.               e  Sort by extension 
  9680.               g  Group subdirectories first, then files 
  9681.               i  Sort by file description 
  9682.               n  Sort by filename (this is the default) 
  9683.               r  Reverse the sort order for all options 
  9684.               s  Sort by size 
  9685.               u  Unsorted 
  9686.  
  9687.     /Z      Display HPFS filenames in FAT format.  Long names will be truncated 
  9688.             to 12 characters.  If the name is longer than 12 characters, it 
  9689.             will be followed by a right arrow to show that one or more 
  9690.             characters have been truncated. 
  9691.  
  9692.  
  9693. ΓòÉΓòÉΓòÉ 14.66. SET - Create or modify environment variables ΓòÉΓòÉΓòÉ
  9694.  
  9695.  Purpose:    Display, create, modify, or delete environment variables. 
  9696.  
  9697.  Format:     SET [/P /R filename...] [name [=][value ]] 
  9698.  
  9699.              filename :  The name of a file containing variable definitions. 
  9700.              name :  The name of the environment variable to define or modify. 
  9701.              value :  The new value for the variable. 
  9702.  
  9703.              /P(ause)                        /R(ead from file) 
  9704.  
  9705.  See also:  ESET and UNSET. 
  9706.  
  9707.  Usage 
  9708.  
  9709.  Every program and command inherits an environment, which is a list of variable 
  9710.  names, each of which is followed by an equal sign and some text.  Many 
  9711.  programs use entries in the environment to modify their own actions. 
  9712.  
  9713.  If you simply type the SET command with no options or arguments, it will 
  9714.  display all the names and values currently stored in the environment. 
  9715.  Typically, you will see an entry called COMSPEC, an entry called PATH, an 
  9716.  entry called CMDLINE, and whatever other environment variables you and your 
  9717.  programs have established: 
  9718.  
  9719.           [c:\] set
  9720.           COMSPEC=C:\4OS2\$OS2.EXE
  9721.           PATH=C:\;C:\OS2;C:\OS2\SYSTEM;C:\UTIL
  9722.           CMDLINE=C:\4OS2\4START.CMD
  9723.  
  9724.  To add a variable to the environment, type SET, a space, the variable name, an 
  9725.  equal sign, and the text: 
  9726.  
  9727.           [c:\] set mine=c:\finance\myfiles
  9728.  
  9729.  The variable name is converted to upper case by 4OS2.  The text after the 
  9730.  equal sign will be left just as you entered it.  If the variable already 
  9731.  exists, its value will be replaced with the new text that you entered. 
  9732.  
  9733.  Normally you should not put a space on either side of the equal sign.  A space 
  9734.  before the equal sign will become part of the name ; a space after the equal 
  9735.  sign will become part of the value. 
  9736.  
  9737.  If you use SET to create a variable with the same name as one of the 4OS2 
  9738.  internal variables, you will disable the internal variable.  If you later 
  9739.  execute a batch file or alias that depends on that internal variable, it may 
  9740.  not operate correctly. 
  9741.  
  9742.  To display the contents of a single variable, type SET plus the variable name: 
  9743.  
  9744.           [c:\] set mine
  9745.  
  9746.  You can edit environment variables with the ESET command.  To remove variables 
  9747.  from the environment, use UNSET, or type SET plus a variable name and an equal 
  9748.  sign: 
  9749.  
  9750.           [c:\] set mine=
  9751.  
  9752.  The variable name is limited to a maximum of 80 characters. The name and value 
  9753.  together cannot be longer than 1,023 characters. 
  9754.  
  9755.  In 4OS2 the size of the environment is set automatically, and increased as 
  9756.  necessary as you add variables. 
  9757.  
  9758.  4OS2 automatically supports the special O/2 BeginLibPath and EndLibPath 
  9759.  variables.  See your OS/2 documentation for details on these variables. 
  9760.  
  9761.  Options 
  9762.  
  9763.     /P:     (Pause) Wait for a key to be pressed after each screen page before 
  9764.             continuing the display.  Your options at the prompt are explained 
  9765.             in detail under Page and File Prompts. 
  9766.  
  9767.     /R:     (Read) Read environment variables from a file.  This is much faster 
  9768.             than loading variables from a batch file with multiple SET 
  9769.             commands.  Each entry in the file must fit within the 1,023-byte 
  9770.             command-line length limit for 4OS2:  The file is in the same format 
  9771.             as the SET display, so SET /R can accept as input a file generated 
  9772.             by redirecting SET output.  For example, the following commands 
  9773.             will save the environment variables to a file, and then reload them 
  9774.             from that file: 
  9775.  
  9776.                                 set > varlist
  9777.                                 set /r varlist
  9778.  
  9779.             You can load variables from multiple files by listing the filenames 
  9780.             individually after the /R. You can add comments to a variable file 
  9781.             by starting the comment line with a colon [:]. 
  9782.  
  9783.             If you are creating a SET /R file by hand, and need to create an 
  9784.             entry that spans multiple lines in the file, you can do so by 
  9785.             terminating each line, except the last, with an escape character. 
  9786.             However, you cannot use this method to exceed the command-line 
  9787.             length limit. 
  9788.  
  9789.  
  9790. ΓòÉΓòÉΓòÉ 14.67. SETDOS - Set the 4OS2 configuration ΓòÉΓòÉΓòÉ
  9791.  
  9792.  Purpose:    Display or set the 4OS2 configuration. 
  9793.  
  9794.  Format:     SETDOS [/B? /C? /D /E? /Fn.n /I+|- command /L? /M? /N? /P? /R? 
  9795.              /S?:? /U? /V? /X[+|-]n /Y?] 
  9796.  
  9797.              /B(right background)            /N(o clobber) 
  9798.              /C(ompound)                     /P(arameter character) 
  9799.              /D(escriptions)                 /R(ows) 
  9800.              /E(scape character)             /S(hape of cursor) 
  9801.              /F(ormat for @EVAL)             /U(pper case) 
  9802.              /I(nternal commands)            /V(erbose) 
  9803.              /L(ine)                         /X (expansion, special characters) 
  9804.              /M(ode for editing)             /Y (single step) 
  9805.  
  9806.  Usage 
  9807.  
  9808.  SETDOS allows you to customize certain aspects of 4OS2 to suit your personal 
  9809.  tastes or the configuration of your system.  Each of these options is 
  9810.  described below. 
  9811.  
  9812.  You can display the value of all SETDOS options by entering the SETDOS command 
  9813.  with no parameters. 
  9814.  
  9815.  Most of the SETDOS options can be initialized when 4OS2 executes the 
  9816.  configuration directives in the .INI file. The name of the corresponding 
  9817.  directive is listed with each option below; if none is listed, that option 
  9818.  cannot be set from the .INI file.  You can also define the SETDOS options in 
  9819.  your AUTOEXEC.BAT, 4START, or other startup file (see Automatic Batch Files), 
  9820.  in aliases, or at the command line. 
  9821.  
  9822.  Secondary shells automatically inherit most configuration settings currently 
  9823.  in effect in the previous shell.  If values have been changed by SETDOS since 
  9824.  4OS2 started, the new values will be passed to the secondary shell. 
  9825.  
  9826.  SETDOS /I settings are not inherited by secondary shells.  If you want to use 
  9827.  SETDOS /I- to disable commands in all shells, place the SETDOS command(s) in 
  9828.  your 4START file, which is executed when any shell starts. 
  9829.  
  9830.  Options 
  9831.  
  9832.     /B:     (Bright background) The BRIGHTBG option determines whether 4OS2 
  9833.             configures your video adapter for blinking text (/B0, the default) 
  9834.             or bright background colors (/B1). /B2 will prevent 4OS2 from 
  9835.             adjusting the bright / blink status. See Colors and Color Names for 
  9836.             a detailed discussion of this option.  Also see the BrightBG 
  9837.             directive. 
  9838.  
  9839.     /C:     (Compound character) The COMPOUND option sets the character used 
  9840.             for separating multiple commands on the same line.  The default is 
  9841.             the ampersand [&]. You cannot use any of the redirection characters 
  9842.             (| > <), or the blank, tab, comma, or equal sign as the command 
  9843.             separator.  This example changes the COMPOUND character to a tilde 
  9844.             [~]: 
  9845.  
  9846.                                 [c:\] setdos /c~
  9847.  
  9848.             If you want to share batch files or aliases between 4DOS and 4OS2 
  9849.             or 4DOS/NT, see the %+ variable, which retrieves the current 
  9850.             command separator, and 4DOS, 4OS2, and 4DOS/NT Compatibility for 
  9851.             details on using compatible command separators for all the products 
  9852.             you use.  Also see the CommandSep directive. 
  9853.  
  9854.     /D:     (Descriptions) The DESCRIPTIONS option controls whether file 
  9855.             processing commands like COPY, DEL, MOVE, and REN process file 
  9856.             descriptions along with the files they belong to.  /D1 turns 
  9857.             description processing on, which is the default.  /D0 turns 
  9858.             description processing off.  Also see the Descriptions directive. 
  9859.             You can also use /D to change the description file name, by placing 
  9860.             the new name (rather than a "0" or "1"), in double quotes, 
  9861.             immediately after the /D.  Use this option with caution, because 
  9862.             changing the name from the default will make it difficult to 
  9863.             transfer file descriptions to another system.  Also see the 
  9864.             DescriptionName directive. 
  9865.  
  9866.  
  9867.     /E:     (Escape character) The ESCAPE option sets the character used to 
  9868.             suppress the normal meaning of the following character.  Any 
  9869.             character following the escape character will be passed unmodified 
  9870.             to the command.  The default escape character is a caret [^]. You 
  9871.             cannot use any of the redirection characters (| > <) or the blank, 
  9872.             tab, comma, or equal sign as the escape character. Certain 
  9873.             characters (b, c, e, f, n, r, s, and t) have special meanings when 
  9874.             immediately preceded by the escape character. 
  9875.  
  9876.             If you want to share batch files or aliases between 4DOS and 4OS2 
  9877.             or 4DOS/NT, see the %= variable, which retrieves the current escape 
  9878.             character, and 4DOS, 4OS2, and 4DOS/NT Compatibility for details on 
  9879.             using compatible escape characters for all the products you use. 
  9880.             Also see the EscapeChar directive. 
  9881.  
  9882.     /F:     (Format for @EVAL) The FORMAT option lets you set default decimal 
  9883.             precision for the @EVAL variable function. The maximum precision is 
  9884.             16 digits to the left of the decimal point and 8 digits to the 
  9885.             right of the decimal point.  By default, the minimum precision to 
  9886.             the right of the decimal point is 0.  The general form of this 
  9887.             option is /Fx.y, where x sets the minimum number of digits to the 
  9888.             right of the decimal place and y sets the maximum number of digits. 
  9889.             Both values can range from 0 to 8; if x is greater than x, it is 
  9890.             ignored.  You can specify either or both values, for example /F2.5, 
  9891.             /F2, and /F.5 are all valid entries. 
  9892.  
  9893.             See @EVAL if you want to set the precision for a single 
  9894.             computation. 
  9895.  
  9896.             Also see the EvalMax and EvalMin directives. 
  9897.     /I:     (Internal) The INTERNAL option allows you to disable or enable 
  9898.             internal commands.  To disable a command, precede the command name 
  9899.             with a minus [-].  To re-enable a command, precede it with a plus 
  9900.             [+]. For example, to disable the internal LIST command to force 
  9901.             4OS2 to use an external command: 
  9902.  
  9903.                                 [c:\] setdos /i-list
  9904.  
  9905.     /L:     (Line) The LINE option controls how 4OS2 gets its input from the 
  9906.             command line.  /L0 tells 4OS2 to use character input (the default). 
  9907.             /L1 tells it to use line input (like CMD.EXE ).  /L1 will disable 
  9908.             command-line editing, history recall, filename completion, and the 
  9909.             directory history window, and will reduce the 4OS2 input length 
  9910.             limit from 1023 characters to 255 characters.  It should only be 
  9911.             used if it is needed for compatibility with a specific program.  If 
  9912.             you have a program that requires line input, you can use the 
  9913.             following line in an alias or batch file to change the line input 
  9914.             option just for that single program (change the command separator 
  9915.             to an ampersand [&] for 4OS2): 
  9916.  
  9917.                                 setdos /L1 & program %& & setdos /L0
  9918.  
  9919.             See README.DOC for information on programs which require this 
  9920.             option.  Also see the LineInput directive. 
  9921.  
  9922.     /M:     (Mode) The MODE option controls the initial line editing mode.  To 
  9923.             start in overstrike mode at the beginning of each command line, use 
  9924.             /M0 (the default).  To start in insert mode, use /M1.  Also see the 
  9925.             EditMode directive. 
  9926.  
  9927.     /N:     (No clobber) The NOCLOBBER option controls output redirection). 
  9928.             /N0 means existing files will be overwritten by output redirection 
  9929.             (with >) and that appending (with >>) does not require the file to 
  9930.             exist already.  This is the default.  /N1 means existing files may 
  9931.             not be overwritten by output redirection, and that when appending 
  9932.             the output file must exist.  A /N1 setting can be overridden with 
  9933.             the [!] character.  If you use /N1, you may have problems with a 
  9934.             few unusual programs that shell out to run a command with 
  9935.             redirection, and expect to be able to overwrite an existing file. 
  9936.             Also see the NoClobber directive. 
  9937.  
  9938.     /P:     (Parameter character) This option sets the character used after a 
  9939.             percent sign to specify all or all remaining command-line arguments 
  9940.             in a batch file or alias (e.g., %& or %n&; . The default is the 
  9941.             dollar sign [$]. 
  9942.  
  9943.             If you want to share batch files or aliases between 4DOS and 4OS2 
  9944.             or 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details 
  9945.             on selecting compatible parameter characters for all the products 
  9946.             you use.  Also see the ParameterChar directive. 
  9947.  
  9948.     /R:     (Rows) The ROWS option sets the number of screen rows used by the 
  9949.             video display.  Normally 4OS2 detects the screen size, but if you 
  9950.             have a non-standard display you may need to set it explicitly. 
  9951.             This option does not affect screen scrolling (which is controlled 
  9952.             by your video driver).  It is used only for LIST, SELECT, the paged 
  9953.             output options (i.e., TYPE /P), and error checking in the screen 
  9954.             output commands.  Also see the ScreenRows directive. 
  9955.  
  9956.     /S:     (Shape) The SHAPE option sets the cursor shape.  The format is 
  9957.             /So:i where o is the cursor size for overstrike mode, i the cursor 
  9958.             size for insert mode.  The size is entered as a percentage of the 
  9959.             total character height.  The default values are 10:100 (an 
  9960.             underscore cursor for overstrike mode, and a block cursor for 
  9961.             insert mode).  Because of the way video drivers remap the cursor 
  9962.             shape, you may not get a smooth progression in the cursor size from 
  9963.             0% - 100%.  To disable the cursor, enter /S0:0.  If either value is 
  9964.             -1, 4OS2 will not attempt to modify the cursor shape at all.  You 
  9965.             can use this feature to give another program full control of the 
  9966.             cursor shape. Also see the CursorOver and CursorIns directives. 
  9967.  
  9968.     /U:     (Upper) The UPPER option controls the default case ( upper or 
  9969.             lower) for file and directory names displayed by internal commands 
  9970.             like COPY and DIR.  /U0 displays file names in lower case (the 
  9971.             default).  /U1 displays file names in the traditional upper case. 
  9972.             The /U setting is ignored for HPFS filenames.  HPFS names are 
  9973.             always displayed in the case in which they are stored. Also see the 
  9974.             UpperCase directive. 
  9975.  
  9976.     /V:     (Verbose) The VERBOSE option controls the default for command 
  9977.             echoing in batch files.  /V0 disables echoing of batch file 
  9978.             commands unless ECHO is explicitly set ON.  /V1, the default 
  9979.             setting, enables echoing of batch file commands unless ECHO is 
  9980.             explicitly set OFF.  Also see the BatchEcho directive. 
  9981.  
  9982.             /V2 forces echoing of all batch file commands, even if ECHO is set 
  9983.             OFF or the line begins with an "@".  This allows you to turn 
  9984.             echoing on for a batch file without editing the batch file and 
  9985.             removing the ECHO OFF command(s) within it.  /V2 is intended for 
  9986.             debugging, and can be set with SETDOS, but not with the BatchEcho 
  9987.             directive in 4OS2.INI. 
  9988.  
  9989.     /X[+|-]n(eXpansion and special characters): This option enables and 
  9990.             disables alias and environment variable expansion, and controls 
  9991.             whether special characters have their usual meaning or are treated 
  9992.             as text.  It is most often used in batch files to process text 
  9993.             strings which may contain special characters. 
  9994.  
  9995.             The features enabled or disabled by /X are numbered.  All features 
  9996.             are enabled when 4OS2 starts, and you can re-enable all features at 
  9997.             any time by using /X0.  To disable a particular feature, use /X-n, 
  9998.             where n is the feature number from the list below.  To re-enable 
  9999.             the feature, use /X+n.  To enable or disable multiple individual 
  10000.             features, list their numbers in sequence after the + or - (e.g. /X- 
  10001.             345 to disable features 3, 4, and 5). 
  10002.  
  10003.             The features are: 
  10004.  
  10005.               1  All alias expansion. 
  10006.               2  Nested alias expansion only. 
  10007.               3  All variable expansion (environment variables and batch and 
  10008.             alias parameters) 
  10009.               4  Nested variable expansion only. 
  10010.               5  Multiple commands, conditional commands, and piping 
  10011.               6  Redirection 
  10012.               7  Quoting (double quotes and back quotes) and square brackets 
  10013.               8  Escape character. 
  10014.  
  10015.             If nested alias expansion is disabled, the first alias of a command 
  10016.             is expanded but any aliases it invokes are not expanded.  If nested 
  10017.             variable expansion is disabled, each variable is expanded once, but 
  10018.             variables containing the names of other variables are not expanded 
  10019.             further. 
  10020.  
  10021.             For example, to disable all features except alias expansion while 
  10022.             you are processing a text file containing special characters: 
  10023.  
  10024.                                 setdos /x-35678
  10025.                                 ... [perform text processing here]
  10026.                                 setdos /x0
  10027.  
  10028.     /Y:     (Single step) /Y1 enables single-stepping through a batch file. 
  10029.             Each command is displayed on the screen along with a Y/N/R (yes / 
  10030.             no / remainder) prompt.  Press Y to execute the command, N to omit 
  10031.             the command and go on to the next, or R or Esc to execute the 
  10032.             remainder of the batch file (up to the next SETDOS /Y1 command). 
  10033.             You may also press Ctrl-C or Ctrl-Break to terminate the batch 
  10034.             file. 
  10035.  
  10036.             Batch file single stepping is disabled each time 4OS2 returns to 
  10037.             the command prompt. This means you cannot enter the SETDOS /Y1 
  10038.             command at the prompt, press Enter, and start a batch file in 
  10039.             single step mode at the next prompt.  However you can enable single 
  10040.             step operation and run a batch file from the prompt if you enter 
  10041.             both commands on one line. For example, this command runs 
  10042.             FILECOMP.CMD with single step enabled: 
  10043.  
  10044.                                 [c:\] setdos /y1 & filecomp.cmd
  10045.  
  10046.  
  10047. ΓòÉΓòÉΓòÉ 14.68. SETLOCAL - Save the environment ΓòÉΓòÉΓòÉ
  10048.  
  10049.  Purpose:    Save a copy of the current disk drive, directory, environment, and 
  10050.              alias list. 
  10051.  
  10052.  Format:     SETLOCAL 
  10053.  
  10054.  See also:  ENDLOCAL. 
  10055.  
  10056.  Usage 
  10057.  
  10058.  SETLOCAL is used in batch files to save the default disk drive and directory, 
  10059.  the environment, and the alias list to a reserved block of memory.  You can 
  10060.  then change their values and later restore the original values with the 
  10061.  ENDLOCAL command. 
  10062.  
  10063.  For example, this batch file fragment saves everything, removes all aliases so 
  10064.  that user aliases will not affect batch file commands, changes the disk and 
  10065.  directory, modifies a variable, runs a program, and then restores the original 
  10066.  values: 
  10067.  
  10068.           setlocal
  10069.           unalias *
  10070.           cdd d:\test
  10071.           set path=c:\;c:\dos;c:\util
  10072.           rem run some program here
  10073.           endlocal
  10074.  
  10075.  SETLOCAL and ENDLOCAL are not nestable within a batch file. However, you can 
  10076.  have multiple SETLOCAL / ENDLOCAL pairs within a batch file, and nested batch 
  10077.  files can each have their own SETLOCAL / ENDLOCAL.  You cannot use SETLOCAL in 
  10078.  an alias or at the command line. 
  10079.  
  10080.  An ENDLOCAL is performed automatically at the end of a batch file if you 
  10081.  forget to do so.  If you invoke one batch file from another without using 
  10082.  CALL, the first batch file is terminated, and an automatic ENDLOCAL is 
  10083.  performed.  The second batch file inherits the drive, directory, aliases, and 
  10084.  environment variables as they were prior to any unterminated SETLOCAL. 
  10085.  
  10086.  
  10087. ΓòÉΓòÉΓòÉ 14.69. SHIFT - Shift batch file parameters ΓòÉΓòÉΓòÉ
  10088.  
  10089.  Purpose:    Allows the use of more than 127 parameters in a batch file. 
  10090.  
  10091.  Format:     SHIFT [n ] 
  10092.  
  10093.              n :  Number of positions to shift. 
  10094.  
  10095.  Usage 
  10096.  
  10097.  SHIFT is provided for compatibility with older batch files, where it was used 
  10098.  to access more than 10 parameters.  4OS2 supports 128 parameters (%0 to %127), 
  10099.  so you may not need to use SHIFT for batch files running exclusively under JP 
  10100.  Software command processors. 
  10101.  
  10102.  SHIFT moves each of the batch file parameters n positions to the left.  The 
  10103.  default value for n is 1.  SHIFT 1 moves the parameter in %1 to position %0, 
  10104.  the parameter in %2 becomes %1, etc.  You can reverse a SHIFT by giving a 
  10105.  negative value for n (i.e., after SHIFT -1, the former %0 is restored, %0 
  10106.  becomes %1, %1 becomes %2, etc.). 
  10107.  
  10108.  SHIFT also affects the parameters %n$. (command-line tail) and %# (number of 
  10109.  command arguments). 
  10110.  
  10111.  
  10112. ΓòÉΓòÉΓòÉ 14.70. START - Start a program in another session ΓòÉΓòÉΓòÉ
  10113.  
  10114.  Purpose:    Start a program in another session or window. 
  10115.  
  10116.  Format:     START ["program title "] [/B[G] /C /DOS[=optfile ] /F[G] /FS /I 
  10117.              /ICON=iconfile /INV /K /L /LA /LH /MAX /MIN /N /PGM progname /PM 
  10118.              /POS=col,row,width,height /WAIT /WIN /WIN3[=optfile ] 
  10119.              /WIN3S[=optfile ]] [command ] 
  10120.  
  10121.              program title :  Title to appear on title bar. 
  10122.              optfile :  Option settings file. 
  10123.              iconfile :  Name of icon (.ICO ) file. 
  10124.              progname :  Program name (not the session name). 
  10125.              path :  Startup directory. 
  10126.              command :  Command to be executed. 
  10127.  
  10128.              /B[G] (background session)      /LH (local history list) 
  10129.              /C(lose when done)              /MAX(imized) 
  10130.              /DOS (DOS session)              /MIN(imized) 
  10131.              /F[G] (foreground session)      /N(o 4OS2.EXE ) 
  10132.              /FS (full screen)               /PGM (program name) 
  10133.              /I(nherit environment)          /PM (PM application) 
  10134.              /ICON (.ICO file)               /POS(ition of window) 
  10135.              /INV(isible)                    /WAIT (for session to finish) 
  10136.              /K(eep when done)               /WIN(dowed session) 
  10137.              /L(ocal lists)                  /WIN3 (Windows enhanced mode) 
  10138.              /LA (local aliases)             /WIN3S (Windows standard mode) 
  10139.              /LD (local dir history) 
  10140.  
  10141.  See also:  DETACH. 
  10142.  
  10143.  Usage 
  10144.  
  10145.  START is used to begin a new OS/2 session, and optionally run a program in 
  10146.  that session.  If you use START with no parameters, it will begin a new 
  10147.  command-line session.  If you add a command, START will begin a new session or 
  10148.  window and execute that command. 
  10149.  
  10150.  The program title, if it is included, will appear on the title bar, and on the 
  10151.  Presentation Manager task list (OS/2 version 1.x) or window list (OS/2 version 
  10152.  2.x and above).  The program title must be enclosed in quotation marks and 
  10153.  cannot exceed 60 characters.  If the program title is omitted, the program 
  10154.  name will be used as the title. 
  10155.  
  10156.  START offers a large number of switches to control the session you start.  In 
  10157.  most cases you need only a few switches to accomplish what you want.  The list 
  10158.  below summarizes the most commonly used START options, and how you can use 
  10159.  them to control the way a session is started: 
  10160.  
  10161.         /MAX, /MIN, and /POS allow you to start a character-mode windowed 
  10162.         session in a maximized window, a minimized window, or a window with a 
  10163.         specified position and size.  The default is to let the operating 
  10164.         environment choose the position and size of the window. 
  10165.  
  10166.         /C allows you to close the session when the command is finished (the 
  10167.         default for DOS and OS/2 Presentation Manager sessions); /K allows you 
  10168.         to keep the session open and go to a prompt (the default for OS/2 
  10169.         character mode sessions). 
  10170.  
  10171.         /BG and /FG allow you to start the session in the background(does not 
  10172.         respond to keystrokes until selected) or foreground (responds to 
  10173.         keystrokes until deselected).  /FG is the default if /DOS, /FS, /WIN, 
  10174.         or /PM is used; otherwise, /BG is the default. 
  10175.  
  10176.         /FS and /WIN control whether a character-mode session is started in 
  10177.         full-screen or windowed mode.  The default is to start a session of the 
  10178.         same type as the current session, if the application can be run in such 
  10179.         a session. 
  10180.  
  10181.  START determines the application type automatically and starts the session in 
  10182.  the appropriate mode:  OS/2, Windows, DOS, full-screen, windowed, or 
  10183.  Presentation Manager. 
  10184.  
  10185.  START gives you some flexibility in determining the session mode. For example, 
  10186.  if the command is the name of a batch file (either a .BTM or .CMD file), you 
  10187.  can use the /FS or /WIN options to run the batch file as part of a new 4OS2 
  10188.  session in either full-screen or windowed mode. 
  10189.  
  10190.  However, you cannot start a session in a mode that is inappropriate for the 
  10191.  application type.  A DOS application cannot be run as part of a Presentation 
  10192.  Manager session, for example, even if you use the /PM switch.  Invalid or 
  10193.  conflicting options will be ignored. 4OS2 will always attempt to run the 
  10194.  command in the appropriate type of session. 
  10195.  
  10196.  If the program is a DOS application or .BAT file, 4OS2 will return an error 
  10197.  message in OS/2 version 1.x.  In OS/2 version 2.x and above, 4OS2 will start a 
  10198.  new DOS session to run the program or batch file. The DOS session will close 
  10199.  itself automatically as soon as the program or batch file ends, unless /K is 
  10200.  used.  If you want the session to wait for a keystroke before it closes 
  10201.  itself, you can use the syntax: 
  10202.  
  10203.           [c:\] start /DOS command ^^ pause
  10204.  
  10205.  (Because the caret [^] is the default 4OS2 escape character, two carets must 
  10206.  be used in order to pass one on to 4DOS as a command separator.) 
  10207.  
  10208.  If you want to start a DOS command-line session in OS/2 version 2.x, you can 
  10209.  use the command: 
  10210.  
  10211.           [c:\] start /DOS
  10212.  
  10213.  You can specify settings for DOS and Windows sessions by using a settings 
  10214.  options file, and loading it with the /DOS=, /WIN3=, or /WIN3S= option.  This 
  10215.  allows you to start DOS and Windows sessions with specific settings without 
  10216.  creating a desktop object and modifying the settings manually.  Before using 
  10217.  this capability you should read the description of it under /DOS= (below) very 
  10218.  carefully, since errors in the settings file can occasionally hang your 
  10219.  system. 
  10220.  
  10221.  Options 
  10222.  
  10223.     /BG:        (BackGround session) The session is started as a background 
  10224.                 session.  /BG may be abbreviated to /B. 
  10225.  
  10226.     /C:         (Close) The session or window is closed when the application 
  10227.                 ends. 
  10228.  
  10229.     /DOS[=filename]:(DOS session) Start a DOS session under OS/2 version 2.x 
  10230.                 and above.  This option is not available in OS/2 version 1.x, 
  10231.                 which doesn't allow multiple DOS sessions. 
  10232.  
  10233.                 If you include the =filename, OS/2 will load DOS settings from 
  10234.                 the specified file.  This option is available only in the 
  10235.                 32-bit version of 4OS2. 
  10236.  
  10237.                 Starting a session with specific DOS settings is an 
  10238.                 undocumented feature which was implemented within OS/2 with 
  10239.                 little error checking.  It is included in START because it 
  10240.                 substantially eases a complex task, but you must experiment 
  10241.                 carefully to ensure that the settings you select will work 
  10242.                 properly on the systems on which you plan to use them. 
  10243.                 Incorrect settings may be ignored, but they may also hang your 
  10244.                 session or stop the entire system.  Be sure your experiments 
  10245.                 are not conducted while critical tasks are in process. 
  10246.  
  10247.                 Each line in the file must have a name, an equal sign [=], and 
  10248.                 a value.  The names are those shown in OS/2's DOS Settings 
  10249.                 dialog box.  Do not use spaces on either side of the equal 
  10250.                 sign. 
  10251.  
  10252.                 The names in the DOS Settings dialog box will vary depending on 
  10253.                 the device drivers and other settings in your CONFIG.SYS file, 
  10254.                 though many are available on all systems.  You must ensure that 
  10255.                 the names you use are valid for the systems on which you use 
  10256.                 them.  For example, if you replace IBM's COM.SYS and VCOM.SYS 
  10257.                 with different communications drivers, the COM_ settings will 
  10258.                 probably not be valid for the new drivers.  If you have a 
  10259.                 settings file which contains settings defined by a particular 
  10260.                 driver, and use it on a system where the corresponding driver 
  10261.                 is not loaded, the results are undefined. 
  10262.  
  10263.                 The values in your settings file must be numeric for settings 
  10264.                 which show a numeric value under DOS Settings (e.g., 
  10265.                 DOS_FILES=30), and must be text strings for settings shown with 
  10266.                 a string (e.g., DOS_SHELL=C:\4DOS.COM C:\4DOS /P).  Strings 
  10267.                 should be entered without trailing blanks.  For values shown as 
  10268.                 multiple choice on the DOS Settings page you must specify a 
  10269.                 numeric value, typically "0" for Off and 1 for On (e.g., 
  10270.                 DOS_HIGH=1).  Items with choices other than Off and On may use 
  10271.                 different values, or may not work at all; experimentation is 
  10272.                 usually required to find out what works.  Attempting to use 
  10273.                 strings for choice items (e.g., DOS_HIGH=ON) will not work, and 
  10274.                 can hang your system.  This is due to the internal operation of 
  10275.                 OS/2, and is not a problem in 4OS2. 
  10276.  
  10277.                 A typical DOS settings file might look like this: 
  10278.  
  10279.                                         DOS_FILES=30
  10280.                                         DOS_HIGH=1
  10281.                                         DOS_SHELL=C:\4DOS\4DOS.COM C:\4DOS /P
  10282.                                         MOUSE_EXCLUSIVE_ACCESS=0
  10283.                                         VIDEO_FASTPASTE=1
  10284.  
  10285.                 You can include comments in a settings file by beginning any 
  10286.                 line with a colon [:]. 
  10287.  
  10288.     /FG:        (ForeGround session) Start the session as the foreground 
  10289.                 session.  /FG may be abbreviated to /F. 
  10290.  
  10291.     /FS:        (Full Screen) Start the session as a full-screen session. 
  10292.  
  10293.     /I:         (Inherit environment) Inherit the default environment specified 
  10294.                 in CONFIG.SYS, if any, rather than the current environment. 
  10295.  
  10296.     /ICON=filename:Use the specified icon file.  If you don't use /ICON, 4OS2 
  10297.                 will look for an .ICO file with the same file name and in the 
  10298.                 same directory as the program file.  Some versions of OS/2 may 
  10299.                 ignore this option and use the default icon for the session. 
  10300.                 If you encounter this problem, check whether an update to OS/2 
  10301.                 has been released which addresses it. 
  10302.  
  10303.     /INV:       (Invisible) Start the session or window as invisible.  No icon 
  10304.                 will appear and the session will only be accessible through the 
  10305.                 Task Manager or Window List. 
  10306.  
  10307.     /K:         (Keep session or window at end) The session or window continues 
  10308.                 after the application program ends.  Use the EXIT command to 
  10309.                 end the session. 
  10310.  
  10311.     /L:         (Local lists) Start 4OS2 with local alias, history, and 
  10312.                 directory history lists.  This option combines the effects of 
  10313.                 /LA, /LD, and /LH (below). 
  10314.  
  10315.     /LA:        (Local Alias list) Start 4OS2 with a local alias list.See ALIAS 
  10316.                 for information on local and global aliases. 
  10317.  
  10318.     /LD:        (Local Directory history) Start 4OS2 with a local directory 
  10319.                 history list.  See Local and Global Directory History for more 
  10320.                 information. 
  10321.  
  10322.     /LH:        (Local History list) Start 4OS2 with a local history list. See 
  10323.                 Command History and Recall for information on local and global 
  10324.                 history lists. 
  10325.  
  10326.     /MAX:       (Maximized) Start the session or window maximized. 
  10327.  
  10328.     /MIN:       (Minimized) Start the session or window minimized. 
  10329.  
  10330.     /N:         Under 4OS2, start an OS/2 program directly, without a command 
  10331.                 processor.  The command cannot be an internal command or batch 
  10332.                 file. This is the default for PM applications. 
  10333.  
  10334.     /PGM:       (Program name) The string following this option is the program 
  10335.                 name.  The first quoted string on the line will be used as the 
  10336.                 session and task list title, and not as the program name. 
  10337.  
  10338.     /PM:        (Presentation Manager) Start a program in the PM session. 
  10339.  
  10340.     /POS:       (Position) Start the window at the specified screen position. 
  10341.                 The syntax is /POS=col, row, width, height where the values are 
  10342.                 specified in pixels or pels.  Row and col refer to the position 
  10343.                 of the top left corner of the window relative to the bottom 
  10344.                 left corner of the screen. 
  10345.  
  10346.     /WAIT:      Wait for the new session or window to finish before continuing. 
  10347.                 Cannot be used with /WIN3 or /WIN3S. 
  10348.  
  10349.     /WIN:       (Windowed) Start the session in a window. 
  10350.  
  10351.     /WIN3[=filename]:(Windows enhanced mode) Run the program in an 
  10352.                 enhanced-mode Windows 3.x session.  The session will run 
  10353.                 seamless (on the OS/2 desktop).  To start a Windows application 
  10354.                 in full-screen mode, use /FS rather than /WIN3.  You can 
  10355.                 include an equal sign and the name of an options file to set 
  10356.                 options for the specific session and application (see /DOS= 
  10357.                 above for details).  The setting names in the file should be 
  10358.                 taken from those shown in OS/2's WIN-OS/2 Settings dialog box. 
  10359.                 Available only in the 32-bit version of 4OS2. 
  10360.  
  10361.     /WIN3S[=filename]:(Windows standard mode) Equivalent to /WIN3, but runs the 
  10362.                 program in standard mode rather than enhanced mode. Available 
  10363.                 only in 4OS2/32. 
  10364.  
  10365.  
  10366. ΓòÉΓòÉΓòÉ 14.71. SHRALIAS - Load or unload SHRALIAS.EXE ΓòÉΓòÉΓòÉ
  10367.  
  10368.  Purpose:    Load or unload SHRALIAS.EXE, which saves shared aliases, history, 
  10369.              and directory history between 4OS2 sessions. 
  10370.  
  10371.  Format:     SHRALIAS [/U] 
  10372.  
  10373.              /U(nload) 
  10374.  
  10375.  See also:  ALIAS, Command History and Recall, and the Directory History 
  10376.  Window. 
  10377.  
  10378.  Usage: 
  10379.  
  10380.  If you select a global alias, history, or directory history list for 4OS2 you 
  10381.  can share the list(s) among all copies of 4OS2 running in any session. 
  10382.  However, when you close all 4OS2 sessions the memory for these global lists is 
  10383.  released, and new, empty lists are created the next time you start 4OS2. 
  10384.  
  10385.  SHRALIAS retains one or more of these lists in memory even when no 4OS2 
  10386.  session is running, and makes the information in the retained list(s) 
  10387.  available to the next 4OS2 session that is started. This allows you to keep 
  10388.  your aliases, command history, and directory history between 4OS2 sessions (as 
  10389.  long as OS/2 is not restarted). 
  10390.  
  10391.  Actual retention of the shared lists is handled by the SHRALIAS.EXE program. 
  10392.  The internal SHRALIAS command is used to load and unload SHRALIAS.EXE. 
  10393.  (SHRALIAS.EXE is distributed as part of 4OS2, and must be located in your 4OS2 
  10394.  directory, or a directory on your PATH.) 
  10395.  
  10396.  To load SHRALIAS.EXE, enter the SHRALIAS command with no parameters: 
  10397.  
  10398.           [c:\] shralias
  10399.  
  10400.  SHRALIAS.EXE runs as a "detached" process, which means it does not have a 
  10401.  screen display, accept keyboard input, or appear on the OS/2 window list.  It 
  10402.  is shut down automatically when OS/2 shuts down.  You can also unload 
  10403.  SHRALIAS.EXE manually, with SHRALIAS /U: 
  10404.  
  10405.           [c:\] shralias /u
  10406.  
  10407.  Once SHRALIAS.EXE is unloaded any shared alias, history, and directory history 
  10408.  lists will be released when the last copy of 4OS2 terminates. 
  10409.  
  10410.  Do not attempt to load or unload the SHRALIAS.EXE program directly -- it must 
  10411.  be managed with the SHRALIAS command. 
  10412.  
  10413.  You may find it convenient to invoke SHRALIAS from your 4START file.  If you 
  10414.  do, once SHRALIAS.EXE is loaded additional attempts to reload it (for example, 
  10415.  when a second or subsequent 4OS2 session runs TCSTART) will be ignored, and 
  10416.  will display the informational message "SHRALIAS already loaded".  Similarly, 
  10417.  if you attempt to unload SHARLIAS.EXE with the SHRALIAS /U command and it has 
  10418.  not been loaded, 4OS2 will display the message "SHRALIAS not loaded". 
  10419.  
  10420.  SHRALIAS must be invoked from a 4OS2 session which uses at least one global 
  10421.  list.  If you invoke it from a session where the alias list, history list, and 
  10422.  directory history list are all local, it will not be able to find any shared 
  10423.  memory to retain, and will display an error. 
  10424.  
  10425.  Option: 
  10426.  
  10427.     /U      (Unload) Unload SHRALIAS.EXE from memory. 
  10428.  
  10429.  
  10430. ΓòÉΓòÉΓòÉ 14.72. TEE - "Tee" pipe fitting ΓòÉΓòÉΓòÉ
  10431.  
  10432.  Purpose:    Copy standard input to both standard output and a file. 
  10433.  
  10434.  Format:     TEE [/A] file... 
  10435.  
  10436.              file :  One or more files that will receive the "tee-d" output. 
  10437.  
  10438.              /A(ppend) 
  10439.  
  10440.  See also:  Y and the redirection options. 
  10441.  
  10442.  Usage 
  10443.  
  10444.  TEE is normally used to "split" the output of a program so that you can see it 
  10445.  on the display and also save it in a file.  It can also be used to capture 
  10446.  intermediate output before the data is altered by another program or command. 
  10447.  
  10448.  TEE gets its input from standard input (usually the piped output of another 
  10449.  command or program), and sends out two copies:  one goes to standard output, 
  10450.  the other to the file or files that you specify.  TEE is not likely to be 
  10451.  useful with programs which do not use standard output, because these programs 
  10452.  cannot send output through a pipe. 
  10453.  
  10454.  For example, to search the file DOC for any lines containing the string 
  10455.  "4OS2", make a copy of the matching lines in 4.DAT, sort the lines, and write 
  10456.  them to the output file 4O.DAT : 
  10457.  
  10458.           [c:\] find "4OS2" doc | tee 4.dat | sort > 4o.dat
  10459.  
  10460.  If you are typing at the keyboard to produce the input for TEE, you must enter 
  10461.  a Ctrl-Z to terminate the input. 
  10462.  
  10463.  When using TEE with a pipe under 4OS2, the programs on the two ends of the 
  10464.  pipe run simultaneously, not sequentially as in 4DOS. 
  10465.  
  10466.  See Piping for more information on pipes. 
  10467.  
  10468.  Option 
  10469.  
  10470.     /A:     (Append) Append the output to the file(s) rather than overwriting 
  10471.             them. 
  10472.  
  10473.  
  10474. ΓòÉΓòÉΓòÉ 14.73. TEXT - Display text in a batch file ΓòÉΓòÉΓòÉ
  10475.  
  10476.  Purpose:    Display a block of text in a batch file. 
  10477.  
  10478.  Format:     TEXT 
  10479.                 . 
  10480.                 . 
  10481.                 . 
  10482.              ENDTEXT 
  10483.  
  10484.  See also:  ECHO, SCREEN, SCRPUT, and VSCRPUT. 
  10485.  
  10486.  Usage 
  10487.  
  10488.  TEXT can only be used in batch files. 
  10489.  
  10490.  The TEXT command is useful for displaying menus or multi-line messages.  TEXT 
  10491.  will display all subsequent lines in the batch file until terminated by 
  10492.  ENDTEXT.  Both TEXT and ENDTEXT must be entered as the only command on the 
  10493.  line. 
  10494.  
  10495.  To redirect the entire block of text, use redirection on the TEXT command 
  10496.  itself, but not on the actual text lines or the ENDTEXT line.  No environment 
  10497.  variable expansion or other processing is performed on the lines between TEXT 
  10498.  and ENDTEXT; they are displayed exactly as they are stored in the batch file. 
  10499.  
  10500.  You can change screen colors by inserting ANSI escape sequences anywhere in 
  10501.  the text block.  You can also use a CLS or COLOR command to set the screen 
  10502.  color before executing the TEXT command. 
  10503.  
  10504.  The following batch file fragment displays a simple menu: 
  10505.  
  10506.           @echo off & cls
  10507.           screen 2 0
  10508.           text
  10509.           Enter one of the following:
  10510.              1 - Spreadsheet
  10511.              2 - Word Processing
  10512.              3 - Utilities
  10513.           endtext
  10514.  
  10515.  
  10516. ΓòÉΓòÉΓòÉ 14.74. TIME - Set the system time ΓòÉΓòÉΓòÉ
  10517.  
  10518.  Purpose:    Display or set the current system time. 
  10519.  
  10520.  Format:     TIME [hh [:mm [:ss ]]] [AM | PM] 
  10521.  
  10522.              hh :  The hour (0 - 23). 
  10523.              mm :  The minute (0 - 59). 
  10524.              ss :  The second (0 - 59). 
  10525.  
  10526.  See also:  CHCP and DATE. 
  10527.  
  10528.  Usage 
  10529.  
  10530.  If you don't enter any parameters, TIME will display the current system time 
  10531.  and prompt you for a new time.  Press Enter if you don't wish to change the 
  10532.  time; otherwise, enter the new time: 
  10533.  
  10534.           [c:\] time
  10535.           Thu  Dec 22, 1994  9:30:10
  10536.           New time (hh:mm:ss):
  10537.  
  10538.  TIME defaults to 24-hour format, but you can optionally enter the time in 
  10539.  12-hour format by appending "a", "am", "p", or "pm" to the time you enter. 
  10540.  
  10541.  For example, to enter the time as 9:30 am: 
  10542.  
  10543.           [c:\] time 9:30 am
  10544.  
  10545.  OS/2 adds the system time and date to the directory entry for every file you 
  10546.  create or modify.  If you keep both the time and date accurate, you will have 
  10547.  a record of when you last updated each file. 
  10548.  
  10549.  
  10550. ΓòÉΓòÉΓòÉ 14.75. TIMER - Start or stop a stopwatch ΓòÉΓòÉΓòÉ
  10551.  
  10552.  Purpose:    TIMER is a system stopwatch. 
  10553.  
  10554.  Format:     TIMER [ON] [/1 /2 /3 /S] 
  10555.  
  10556.              ON:  Force the stopwatch to restart 
  10557.  
  10558.              /1 (stopwatch #1)               /3 (stopwatch #3) 
  10559.              /2 (stopwatch #2)               /S(plit) 
  10560.  
  10561.  Usage 
  10562.  
  10563.  The TIMER command turns a system stopwatch on and off.  When you first run 
  10564.  TIMER, the stopwatch starts: 
  10565.  
  10566.           [c:\] timer
  10567.           Timer 1 on:  12:21:46
  10568.  
  10569.  When you run TIMER again, the stopwatch stops and the elapsed time is 
  10570.  displayed: 
  10571.  
  10572.           [c:\] timer
  10573.           Timer 1 off:  12:21:58   Elapsed time: 0:00:12.06
  10574.  
  10575.  There are three stopwatches available (1, 2, and 3) so you can time multiple 
  10576.  overlapping events.  By default, TIMER uses stopwatch #1. 
  10577.  
  10578.  The smallest interval TIMER can measure depends on the operating system you 
  10579.  are using, your hardware, and the interaction between the two.  However, it 
  10580.  should never be greater than .06 second.  The largest interval is 23 hours, 59 
  10581.  minutes, 59.99 seconds. 
  10582.  
  10583.  Options 
  10584.  
  10585.     /1:     Use timer #1 (the default). 
  10586.  
  10587.     /2:     Use timer #2. 
  10588.  
  10589.     /3:     Use timer #3. 
  10590.  
  10591.     /S:     (Split) Display a split time without stopping the timer.  To 
  10592.             display the current elapsed time but leave the timer running: 
  10593.  
  10594.                                 [c:\] timer /s
  10595.                                 Timer 1 elapsed: 0:06:40.63
  10596.  
  10597.     ON:     Start the timer regardless of its previous state (on or off). 
  10598.             Otherwise the TIMER command toggles the timer state (unless /S is 
  10599.             used). 
  10600.  
  10601.  
  10602. ΓòÉΓòÉΓòÉ 14.76. TYPE - Display file(s) ΓòÉΓòÉΓòÉ
  10603.  
  10604.  Purpose:    Display the contents of the specified file(s). 
  10605.  
  10606.  Format:     TYPE [/A:[[-]rhsda] /L /P] file... 
  10607.  
  10608.              file :  The file or list of files that you want to display. 
  10609.  
  10610.              /A:(ttribute select)            /P(ause) 
  10611.              /L(ine numbers) 
  10612.  
  10613.  See also:  LIST. 
  10614.  
  10615.  File Selection 
  10616.  
  10617.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  10618.  
  10619.  Usage 
  10620.  
  10621.  The TYPE command displays a file.  It is normally only useful for displaying 
  10622.  ASCII text files.  Executable files (.COM and .EXE ) and many data files may 
  10623.  be unreadable when displayed with TYPE because they include non-alphanumeric 
  10624.  characters. 
  10625.  
  10626.  To display the files MEMO1 and MEMO2 : 
  10627.  
  10628.           [c:\] type /p memo1 memo2
  10629.  
  10630.  You can press Ctrl-S to pause TYPE's display and then any key to continue. 
  10631.  
  10632.  You will probably find LIST to be more useful for displaying files. However, 
  10633.  the TYPE /L command used with redirection is useful if you want to add line 
  10634.  numbers to a file. 
  10635.  
  10636.  Options 
  10637.  
  10638.     /A:     (Attribute select) Select only those files that have the specified 
  10639.             attribute(s) set.  Preceding the attribute character with a hyphen 
  10640.             [-] will select files that do not have that attribute set.  The 
  10641.             colon [:] after /A is required.  The attributes are: 
  10642.  
  10643.                            R  Read-only 
  10644.                            H  Hidden 
  10645.                            S  System 
  10646.                            D  Subdirectory 
  10647.                            A  Archive 
  10648.  
  10649.             If no attributes are listed at all (e.g., TYPE /A: ...), TYPE will 
  10650.             select all files and subdirectories including hidden and system 
  10651.             files.  If attributes are combined, all the specified attributes 
  10652.             must match for a file to be selected. For example, /A:RHS will 
  10653.             select only those files with all three attributes set. 
  10654.  
  10655.     /L:     (Line numbers) Display a line number preceding each line of text. 
  10656.  
  10657.     /P:     (Pause) Prompt after displaying each page.  Your options at the 
  10658.             prompt are explained in detail under Page and File Prompts. 
  10659.  
  10660.  
  10661. ΓòÉΓòÉΓòÉ 14.77. UNALIAS - Remove aliases ΓòÉΓòÉΓòÉ
  10662.  
  10663.  Purpose:    Remove aliases from the alias list. 
  10664.  
  10665.  Format:     UNALIAS [/Q] alias... 
  10666.                 or 
  10667.              UNALIAS * 
  10668.  
  10669.              alias :  One or more aliases to remove from memory. 
  10670.  
  10671.              /Q(uiet) 
  10672.  
  10673.  See also:  ALIAS and ESET. 
  10674.  
  10675.  Usage 
  10676.  
  10677.  4OS2 maintains a list of the aliases that you have defined.  The UNALIAS 
  10678.  command will remove aliases from that list.  You can remove one or more 
  10679.  aliases by name, or you can delete the entire alias list by using the command 
  10680.  UNALIAS *. 
  10681.  
  10682.  For example, to remove the alias DDIR: 
  10683.  
  10684.           [c:\] unalias ddir
  10685.  
  10686.  To remove all the aliases: 
  10687.  
  10688.           [c:\] unalias *
  10689.  
  10690.  Options 
  10691.  
  10692.     /Q:     (Quiet) Prevents UNALIAS from displaying an error message if one or 
  10693.             more of the aliases does not exist.  This option is most useful in 
  10694.             batch files, for removing a group of aliases when some of the 
  10695.             aliases may not have been defined. 
  10696.  
  10697.  
  10698. ΓòÉΓòÉΓòÉ 14.78. UNSET - Remove environment variables ΓòÉΓòÉΓòÉ
  10699.  
  10700.  Purpose:    Remove variables from the environment. 
  10701.  
  10702.  Format:     UNSET  [/Q] name... 
  10703.                 or 
  10704.              UNSET * 
  10705.  
  10706.              name :  One or more variables to remove from the environment. 
  10707.  
  10708.              /Q(uiet) 
  10709.  
  10710.  See also:  ESET and SET. 
  10711.  
  10712.  Usage 
  10713.  
  10714.  UNSET removes one or more variables from the environment.  For example, to 
  10715.  remove the variable CMDLINE: 
  10716.  
  10717.           [c:\] unset cmdline
  10718.  
  10719.  If you use the command UNSET *, all of the environment variables will be 
  10720.  deleted: 
  10721.  
  10722.           [c:\] unset *
  10723.  
  10724.  UNSET is often used in conjunction with the SETLOCAL and ENDLOCAL commands in 
  10725.  order to clear the environment of variables that may cause problems for some 
  10726.  applications. 
  10727.  
  10728.  For more information on environment variables, see the SET command and the 
  10729.  general discussion of the environment. 
  10730.  
  10731.  Use caution when removing environment variables, and especially when using 
  10732.  UNSET *.  Many programs will not work properly without certain environment 
  10733.  variables; for example, 4OS2 uses PATH and DPATH. 
  10734.  
  10735.  Options 
  10736.  
  10737.     /Q:     (Quiet) Prevents UNSET from displaying an error message if one or 
  10738.             more of the variables does not exist.  This option is most useful 
  10739.             in batch files, for removing a group of variables when some of the 
  10740.             variables may not have been defined. 
  10741.  
  10742.  
  10743. ΓòÉΓòÉΓòÉ 14.79. VER - Display the 4OS2 and OS/2 version ΓòÉΓòÉΓòÉ
  10744.  
  10745.  Purpose:    Display the current command processor and operating system 
  10746.              versions. 
  10747.  
  10748.  Format:     VER [/R] 
  10749.  
  10750.              /R(evision level) 
  10751.  
  10752.  Usage 
  10753.  
  10754.  Version numbers consist of a one-digit major version number, a period, and a 
  10755.  one- or two-digit minor version number.  The VER command displays both version 
  10756.  numbers: 
  10757.  
  10758.           [c:\] ver
  10759.  
  10760.           4OS2/32 2.5   OS/2 Version is 2.1
  10761.  
  10762.  Option 
  10763.  
  10764.     /R:     (Revision level) Display the 4OS2 and OS/2 internal revision levels 
  10765.             (if any), plus your 4OS2 serial number and registered name. 
  10766.  
  10767.  
  10768. ΓòÉΓòÉΓòÉ 14.80. VERIFY - Enable or disable disk write verification ΓòÉΓòÉΓòÉ
  10769.  
  10770.  Purpose:    Enable or disable disk write verification or display the 
  10771.              verification state. 
  10772.  
  10773.  Format:     VERIFY [ON | OFF] 
  10774.  
  10775.  Usage 
  10776.  
  10777.  OS/2 maintains an internal verify flag.  When the flag is on, OS/2 attempts to 
  10778.  verify each disk write by making sure that the data written to the disk can be 
  10779.  read back successfully into the computer.  It does not compare the data 
  10780.  written with the data actually placed on disk. 
  10781.  
  10782.  If used without any parameters, VERIFY will display the state of the verify 
  10783.  flag: 
  10784.  
  10785.           [c:\] verify
  10786.           VERIFY is OFF
  10787.  
  10788.  VERIFY is off when the system boots up.  Once it is turned on with the VERIFY 
  10789.  ON command, it stays on until you use the VERIFY OFF command or until you 
  10790.  reboot. 
  10791.  
  10792.  Verification will slow your disk write operations slightly (the effect is not 
  10793.  usually noticeable). 
  10794.  
  10795.  
  10796. ΓòÉΓòÉΓòÉ 14.81. VOL - Display disk volume labels ΓòÉΓòÉΓòÉ
  10797.  
  10798.  Purpose:    Display disk volume label(s). 
  10799.  
  10800.  Format:     VOL [d :] ... 
  10801.  
  10802.              d:  The drive or drives to search for labels. 
  10803.  
  10804.  Usage 
  10805.  
  10806.  Each disk may have a volume label, created when the disk is formatted or with 
  10807.  the external LABEL command.  Also, every floppy disk formatted with DOS 
  10808.  version 4.0 or above, OS/2, or Windows NT has a volume serial number. 
  10809.  
  10810.  The VOL command will display the volume label and, if available, the volume 
  10811.  serial number of a disk volume.  If the disk doesn't have a volume label, VOL 
  10812.  will report that it is "unlabeled."  If you don't specify a drive, VOL 
  10813.  displays information about the current drive: 
  10814.  
  10815.           [c:\] vol
  10816.           Volume in drive C: is MYHARDDISK
  10817.  
  10818.  If available, the volume serial number will appear after the drive label or 
  10819.  name. 
  10820.  
  10821.  To display the disk labels for drives A and B: 
  10822.  
  10823.           [c:\] vol a: b:
  10824.           Volume in drive A: is unlabeled
  10825.           Volume in drive B: is BACKUP_2
  10826.  
  10827.  
  10828. ΓòÉΓòÉΓòÉ 14.82. VSCRPUT - Display text vertically and in color ΓòÉΓòÉΓòÉ
  10829.  
  10830.  Purpose:    Display text vertically in the specified color. 
  10831.  
  10832.  Format:     VSCRPUT  row col [BRIght] [BLInk] fg ON [BRIght] bg text 
  10833.  
  10834.              row :  Starting row number. 
  10835.              col :  Starting column number. 
  10836.              fg :  Foreground text color. 
  10837.              bg :  Background text color. 
  10838.              text :  The text to display. 
  10839.  
  10840.  See also:  SCRPUT. 
  10841.  
  10842.  Usage 
  10843.  
  10844.  VSCRPUT writes text vertically on the screen rather than horizontally.  Like 
  10845.  the SCRPUT command, it uses the colors you specify to write the text.  VSCRPUT 
  10846.  can be used for simple graphs and charts generated by batch files.  It always 
  10847.  leaves the cursor in its current position.  See Colors and Color Names for 
  10848.  details about colors and notes on the use of bright background colors. 
  10849.  
  10850.  The row and column are zero-based, so on a standard 25 line by 80 column 
  10851.  display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can also 
  10852.  specify the row and column as offsets from the current cursor position.  Begin 
  10853.  the value with a plus sign [+] to move down the specified number of rows or to 
  10854.  the right the specified number of columns before displaying text, or with a 
  10855.  minus sign [-] to move up or to the left. 
  10856.  
  10857.  VSCRPUT checks for a valid row and column, and displays a "Usage" error 
  10858.  message if either value is out of range. 
  10859.  
  10860.  
  10861. ΓòÉΓòÉΓòÉ 14.83. WINDOW - Change the window state or title ΓòÉΓòÉΓòÉ
  10862.  
  10863.  Purpose:    Minimize or maximize the current window, restore the default 
  10864.              window size, or change the window title. 
  10865.  
  10866.  Format:     WINDOW [MIN | MAX | RESTORE | /POS=col,row,width,height | "title 
  10867.              "] 
  10868.  
  10869.              title :  A new title for the window. 
  10870.  
  10871.              /POS(ition) 
  10872.  
  10873.  Usage 
  10874.  
  10875.  WINDOW is used to control the appearance and title of the current window. 
  10876.  WINDOW MIN reduces the window to an icon, WINDOW MAX enlarges it to its 
  10877.  maximum size, and WINDOW RESTORE returns the window to its default size and 
  10878.  location on the desktop. 
  10879.  
  10880.  Only one WINDOW option can be used at a time.  To make multiple changes in the 
  10881.  window state (for example, to maximize the window and change its title) you 
  10882.  must issue the WINDOW command once for each change. 
  10883.  
  10884.  You can use the /POS option to set the location and size of the window on the 
  10885.  desktop.  The row and column values of the /POS option select the window's 
  10886.  origin while the width and height values determine its size. 
  10887.  
  10888.  If you specify a new title, the title text must be enclosed in double quotes. 
  10889.  The quotes will not appear as part of the actual title. 
  10890.  
  10891.  Only one WINDOW option can be used at a time.  To make multiple changes in the 
  10892.  window state (for example, to maximize the window and change its title) you 
  10893.  must issue the WINDOW command once for each change. 
  10894.  
  10895.  Option 
  10896.  
  10897.     /POS:   (Position) Set the window position and size on the screen.  The 
  10898.             syntax is /POS=col, row, width, height where the values are 
  10899.             specified in pixels or pels.  Row and col refer to the position of 
  10900.             the top left corner of the window relative to the bottom left 
  10901.             corner of the screen. 
  10902.  
  10903.  
  10904. ΓòÉΓòÉΓòÉ 14.84. Y - "Y" pipe fitting ΓòÉΓòÉΓòÉ
  10905.  
  10906.  Purpose:    Copy standard input to standard output, and then copy the 
  10907.              specified file(s) to standard output. 
  10908.  
  10909.  Format:     Y file ... 
  10910.  
  10911.              file :  The file or list of files to send to standard output. 
  10912.  
  10913.  See also:  TEE. 
  10914.  
  10915.  Usage 
  10916.  
  10917.  The Y command copies input from standard input (usually the keyboard) to 
  10918.  standard output (usually the screen).  Once the input ends, the named files 
  10919.  are appended to standard output. 
  10920.  
  10921.  For example, to get text from standard input, append the files MEMO1 and MEMO2 
  10922.  to it, and send the output to MEMOS : 
  10923.  
  10924.           [c:\] y memo1 memo2 > memos
  10925.  
  10926.  The Y command is most useful if you want to add redirected data to the 
  10927.  beginning of a file instead of appending it to the end.  For example, this 
  10928.  command copies the output of DIR, followed by the contents of  the file 
  10929.  DIREND, to the file DIRALL: 
  10930.  
  10931.           [c:\] dir | y dirend > dirall
  10932.  
  10933.  If you are typing at the keyboard to produce input text for Y, you must enter 
  10934.  a Ctrl-Z to terminate the input. 
  10935.  
  10936.  When using Y with a pipe you must take into account that the programs on the 
  10937.  two ends of the pipe run simultaneously, not sequentially. 
  10938.  
  10939.  See Piping for more information on pipes. 
  10940.  
  10941.  
  10942. ΓòÉΓòÉΓòÉ 15. Error Messages ΓòÉΓòÉΓòÉ
  10943.  
  10944. This section lists error messages generated by 4OS2, and includes a recommended 
  10945. course of action for most errors.  If you are unable to resolve the problem, 
  10946. look through your Introduction and Installation Guide for any additional 
  10947. troubleshooting recommendations, then contact JP Software for technical 
  10948. support. 
  10949.  
  10950. Error messages relating to files are generally reports of errors returned by 
  10951. OS/2.  You may find some of these messages (for example, "Access denied") vague 
  10952. enough that they are not always helpful.  4OS2 includes the file name in file 
  10953. error messages, but is often unable to determine a more accurate explanation of 
  10954. these errors.  The message shown is the best information available based on the 
  10955. error codes returned by OS/2. 
  10956.  
  10957. The following list includes all error messages, in alphabetical order: 
  10958.  
  10959. Access denied:  You tried to write to or erase a read-only file, rename a file 
  10960. or directory to an existing name, create a directory that already exists, 
  10961. remove a read-only directory or a directory with files or subdirectories still 
  10962. in it, or access a file in use by another program in a multitasking system. 
  10963.  
  10964. Alias loop:  An alias refers back to itself either directly or indirectly 
  10965. (i.e., a = b = a), or aliases are nested more than 16 deep.  Correct your alias 
  10966. list. 
  10967.  
  10968. Bad disk unit:  Generally caused by a disk drive hardware failure. 
  10969.  
  10970. Batch file missing:  4OS2 can't find the batch (.BTM or .CMD ) file it was 
  10971. running.  It was either deleted, renamed, moved, or the disk was changed. 
  10972. Correct the problem and rerun the file. 
  10973.  
  10974. Can't copy file to itself:  You cannot COPY or MOVE a file to itself.  4OS2 
  10975. performs full path and filename expansion before copying to ensure that files 
  10976. aren't inadvertently destroyed. 
  10977.  
  10978. Can't create:  4OS2 can't create the specified file.  The disk may be full or 
  10979. write protected, or the file already exists and is read-only, or the root 
  10980. directory is full. 
  10981.  
  10982. Can't delete:  4OS2 can't delete the specified file or directory.  The disk is 
  10983. probably write protected. 
  10984.  
  10985. Can't get directory:  4OS2 can't read the directory.  The disk drive is 
  10986. probably not ready. 
  10987.  
  10988. Can't make directory entry:  4OS2 can't create the filename in the directory. 
  10989. This is usually caused by a full root directory. Create a subdirectory and move 
  10990. some of the files to it. 
  10991.  
  10992. Can't open:  4OS2 can't open the specified file.  Either the file doesn't exist 
  10993. or the disk directory or File Allocation Table is damaged. 
  10994.  
  10995. Can't remove current directory:  You attempted to remove the current directory, 
  10996. which OS/2 does not allow.  Change to the parent directory and try again. 
  10997.  
  10998. Command line too long:  A single command exceeded 1023 characters, or the 
  10999. entire command line exceeded 2047 characters, during alias and variable 
  11000. expansion.  Reduce the complexity of the command or use a batch file.  Also 
  11001. check for an alias which refers back to itself either directly or indirectly. 
  11002.  
  11003. Command only valid in batch file:  You have tried to use a batch file command, 
  11004. like DO or GOSUB, from the command line or in an alias.  A few commands can 
  11005. only be used in batch files (see the individual commands for details). 
  11006.  
  11007. Contents lost before copy:  COPY was appending files, and found one of the 
  11008. source files is the same as the target.  That source file is skipped, and 
  11009. appending continues with the next file. 
  11010.  
  11011. Data error:  OS/2 can't read or write properly to the device. On a floppy 
  11012. drive, this error is usually caused by a defective floppy disk, dirty disk 
  11013. drive heads, or a misalignment between the heads on your drive and the drive on 
  11014. which the disk was created. On a hard drive, this error may indicate a drive 
  11015. that is too hot or too cold, or a hardware problem.  Retry the operation; if it 
  11016. fails again, correct the hardware or diskette problem. 
  11017.  
  11018. Directory stack empty:  POPD or DIRS can't find any entries in the directory 
  11019. stack. 
  11020.  
  11021. Disk is write protected:  The disk cannot be written to.  Check the disk and 
  11022. remove the write-protect tab or close the write- protect window if necessary. 
  11023.  
  11024. Drive not ready -- close door:  The floppy disk drive door is open.  Close the 
  11025. door and try again. 
  11026.  
  11027. Environment already saved:  You have already saved the environment with a 
  11028. previous SETLOCAL command.  You cannot nest SETLOCAL / ENDLOCAL pairs. 
  11029.  
  11030. Error in command-line directive:  You used the //iniline option to place an 
  11031. 4OS2.INI directive on the startup command line, but the directive is in error. 
  11032. A more specific error message follows. 
  11033.  
  11034. Error on line [nnnn] of [filename]:  There is an error in your 4OS2.INI file. 
  11035. The following message explains the error in more detail.  Correct the line in 
  11036. error and restart 4OS2 for your change to take effect. 
  11037.  
  11038. Error reading:  OS/2 experienced an I/O error when reading from a device.  This 
  11039. is usually caused by a bad disk, a device not ready, or a hardware error. 
  11040.  
  11041. Error writing:  OS/2 experienced an I/O error when writing to a device.  This 
  11042. is usually caused by a full disk, a bad disk, a device not ready, or a hardware 
  11043. error. 
  11044.  
  11045. Exceeded batch nesting limit:  You have attempted to nest batch files more than 
  11046. 10 levels deep. 
  11047.  
  11048. File Allocation Table bad:  OS/2  can't access the FAT on the specified disk. 
  11049. This can be caused by a bad disk, a hardware error, or an unusual software 
  11050. interaction. 
  11051.  
  11052. File exists:  The requested output file already exists, and 4OS2 won't 
  11053. overwrite it. 
  11054.  
  11055. File is empty:  You attempted to use an empty file in @SELECT.  Correct the 
  11056. file name or contents and try again. 
  11057.  
  11058. File not found:  4OS2 couldn't find the specified file.  Check the spelling and 
  11059. path name. 
  11060.  
  11061. General failure:  This is usually a hardware problem, particularly a disk drive 
  11062. failure or a device not properly connected to a serial or parallel port.  Try 
  11063. to correct the problem, or reboot and try again.  Also see Data error above; 
  11064. the problems described there can sometimes cause a general failure rather than 
  11065. a data error. 
  11066.  
  11067. Infinite COPY or MOVE loop:  You tried to COPY or MOVE a directory to one of 
  11068. its own subdirectories and used the /S switch, so the command would run 
  11069. forever.  Correct the command and try again. 
  11070.  
  11071. Insufficient disk space:  COPY or MOVE ran out of room on the destination 
  11072. drive.  Remove some files and retry the operation. 
  11073.  
  11074. Invalid character value:  You gave an invalid value for a character directive 
  11075. in the 4OS2.INI file. 
  11076.  
  11077. Invalid choice value:  You gave an invalid value for a "choice" directive (one 
  11078. that accepts a choice from a list, like "Yes" or "No") in the 4OS2.INI file. 
  11079.  
  11080. Invalid color:  You gave an invalid value for a color directive in the 4OS2.INI 
  11081. file. 
  11082.  
  11083. Invalid date:  An invalid date was entered.  Check the syntax and reenter. 
  11084.  
  11085. Invalid directive name:  4OS2 can't recognize the name of a directive in your 
  11086. 4OS2.INI file. 
  11087.  
  11088. Invalid drive:  A bad or non-existent disk drive was specified. 
  11089.  
  11090. Invalid key name:  You tried to make an invalid key substitution in the 
  11091. 4OS2.INI file, or you used an invalid key name in a keystroke alias or command. 
  11092. Correct the error and retry the operation. 
  11093.  
  11094. Invalid numeric value:  You gave an invalid value for a numeric directive in 
  11095. the 4OS2.INI file. 
  11096.  
  11097. Invalid parameter:  4OS2 didn't recognize a parameter.  Check the syntax and 
  11098. spelling of the command you entered. 
  11099.  
  11100. Invalid path:  The specified path does not exist.  Check the disk specification 
  11101. and/or spelling. 
  11102.  
  11103. Invalid path or file name:  You used an invalid path or filename in a directive 
  11104. in the 4OS2.INI file. 
  11105.  
  11106. Invalid time:  An invalid time was entered.  Check the syntax and reenter. 
  11107.  
  11108. Keystroke substitution table full:  4OS2 ran out of room to store keystroke 
  11109. substitutions entered in the 4OS2.INI file.  Reduce the number of key 
  11110. substitutions or contact JP Software for assistance. 
  11111.  
  11112. Label not found:  A GOTO or GOSUB referred to a non-existent label. Check your 
  11113. batch file. 
  11114.  
  11115. Missing ENDTEXT:  A TEXT command is missing a matching ENDTEXT.  Check the 
  11116. batch file. 
  11117.  
  11118. Missing GOSUB:  4OS2 cannot perform the RETURN command in a batch file.  You 
  11119. tried to do a RETURN without a GOSUB, or your batch file has been corrupted. 
  11120.  
  11121. Missing SETLOCAL:  An ENDLOCAL was used without a matching SETLOCAL. 
  11122.  
  11123. No aliases defined:  You tried to display aliases but no aliases have been 
  11124. defined. 
  11125.  
  11126. No closing quote:  4OS2 couldn't find a second matching back quote [`] or 
  11127. double-quote ["] on the command line. 
  11128.  
  11129. No expression:  The expression passed to the %@EVAL variable function is empty. 
  11130. Correct the expression and retry the operation. 
  11131.  
  11132. No room for INI file name:  4OS2 does not have enough space to pass the name of 
  11133. your 4OS2.INI file to secondary shells; see String area overflow for more 
  11134. details.  Any [Secondary] section in 4OS2.INI will be ignored in secondary 
  11135. shells until the problem is corrected and the system or session is restarted. 
  11136.  
  11137. No shared memory found:  The SHRALIAS command could not find any global alias 
  11138. list, history list, or directory history list to retain, because you executed 
  11139. the command from a session with local lists.  Start 4OS2 with at least one 
  11140. global list, then invoke SHRALIAS. 
  11141.  
  11142. Not a windowed session:  You tried to use the WINDOW command in a full-screen 
  11143. session.  WINDOW is valid only in windowed sessions. 
  11144.  
  11145. Not an alias:  The specified alias is not in the alias list. 
  11146.  
  11147. Not in environment:  The specified variable is not in the environment. 
  11148.  
  11149. Not ready:  The specified device can't be accessed. 
  11150.  
  11151. Not same device:  This error usually appears in RENAME.  You cannot rename a 
  11152. file to a different disk drive. 
  11153.  
  11154. Out of memory:  4OS2 or OS/2 had insufficient memory to execute the last 
  11155. command.  Try to free some memory by closing other sessions.  If the error 
  11156. persists, contact JP Software for assistance. 
  11157.  
  11158. Out of paper:  OS/2 detected an out-of-paper condition on one of the printers 
  11159. (LPT1, LPT2, or LPT3).  Check your printer and add paper if necessary. 
  11160.  
  11161. Overflow:  An arithmetic overflow occurred in the %@EVAL variable function. 
  11162. Check the values being passed to %@EVAL. %@EVAL can handle 16 digits to the 
  11163. left of the decimal point and 8 to the right. 
  11164.  
  11165. Read error:  OS/2 encountered a disk read error; usually caused by a bad or 
  11166. unformatted disk. 
  11167.  
  11168. Sector not found:  Disk error, usually caused by a bad or unformatted disk. 
  11169.  
  11170. Seek error:  OS/2 can't seek to the proper location on the disk.  This is 
  11171. generally caused by a bad disk or drive. 
  11172.  
  11173. Sharing violation:  You tried to access a file in use by another program in a 
  11174. multitasking system or on a network.  Wait for the file to become available, or 
  11175. change your method of operation so that another program does not have the file 
  11176. open while you are trying to use it. 
  11177.  
  11178. SHRALIAS already loaded:  You used the SHRALIAS command to load SHRALIAS.EXE, 
  11179. but it was already loaded.  This message is informational and generally does 
  11180. not indicate an error condition. 
  11181.  
  11182. SHRALIAS not loaded:  You used the SHRALIAS /U command to unload SHRALIAS.EXE, 
  11183. but it was never loaded.  This message is informational and may not indicate an 
  11184. error condition. 
  11185.  
  11186. String area overflow:  4OS2 ran out of room to store the text from string 
  11187. directives in the 4OS2.INI file.  Reduce the complexity of the 4OS2.INI file or 
  11188. contact JP Software for assistance. 
  11189.  
  11190. Syntax error:  A command or variable function was entered in an improper 
  11191. format.  Check the syntax and correct the error. 
  11192.  
  11193. Too many open files:  OS/2 has run out of file handles. Try increasing the 
  11194. FILES setting in CONFIG.SYS. 
  11195.  
  11196. Unbalanced parentheses:  The number of left and right parentheses did not match 
  11197. in an expression passed to the %@EVAL variable function.  Correct the 
  11198. expression and retry the operation. 
  11199.  
  11200. Unknown command:  A command was entered that 4OS2 didn't recognize and couldn't 
  11201. find in the current search path.  Check the spelling or PATH specification. 
  11202. You can handle unknown commands with the UNKNOWN_CMD alias (see ALIAS). 
  11203.  
  11204. Variable loop:  A nested environment variable refers to itself, or variables 
  11205. are nested more than 16 deep.  Correct the error and retry the command. 
  11206.  
  11207. Warning:  Can't load 4OS2DLL:  4OS2 cannot find 4OS2DLL.DLL, a library used to 
  11208. support the BEGINLIBPATH and ENDLIBPATH "environment variables" under OS/2 
  11209. Warp.  4OS2DLL.DLL must be in the 4OS2 directory, or on a directory listed in 
  11210. the LIBPATH setting in CONFIG.SYS.  If it is not, BEGINLIBPATH and ENDLIBPATH 
  11211. will not be available, but all other 4OS2 functions will operate normally. 
  11212.  
  11213. Write error:  OS/2 encountered a disk write error; usually caused by a bad or 
  11214. unformatted disk. 
  11215.  
  11216.  
  11217. ΓòÉΓòÉΓòÉ 16. Reference Tables ΓòÉΓòÉΓòÉ
  11218.  
  11219. The reference tables in this section are based on U.S. English conventions. 
  11220. Your system may differ if it is configured for a different country or language. 
  11221. See your operating system documentation for more information about country and 
  11222. language support. 
  11223.  
  11224. To represent the text you type, computers must translate each letter to and 
  11225. from a number.  The code used by all PC-compatible computers for this 
  11226. translation is called ASCII.  Function keys, cursor keys, and Alt keys generate 
  11227. scan codes indicating which key was pressed, but not ASCII codes. The tables in 
  11228. this section cover both kinds of codes. 
  11229.  
  11230. For more information, see: 
  11231.  
  11232.             ASCII Table 
  11233.             Key Codes and Scan Codes Table 
  11234.             Key Codes and Scan Codes Explanation 
  11235.             ANSI Commands 
  11236.  
  11237.  
  11238. ΓòÉΓòÉΓòÉ 16.1. ASCII Table ΓòÉΓòÉΓòÉ
  11239.  
  11240.                       Control Characters
  11241.  
  11242.     Dec  Hex  Chr  Nam  Ctl   Γöé   Dec  Hex  Chr  Nam  Ctl
  11243.     ---  ---  ---  ---  ---   Γöé   ---  ---  ---  ---  ---
  11244.     000   00       NUL   ^@   Γöé   016   10      DLE   ^P
  11245.     001   01      SOH   ^A   Γöé   017   11      DC1   ^Q
  11246.     002   02      STX   ^B   Γöé   018   12      DC2   ^R
  11247.     003   03      ETX   ^C   Γöé   019   13      DC3   ^S
  11248.     004   04      EOT   ^D   Γöé   020   14      DC4   ^T
  11249.     005   05      ENQ   ^E   Γöé   021   15      NAK   ^U
  11250.     006   06      ACK   ^F   Γöé   022   16      SYN   ^V
  11251.     007   07       BEL   ^G   Γöé   023   17      ETB   ^W
  11252.     008   08      BS    ^H   Γöé   024   18      CAN   ^X
  11253.     009   09       HT    ^I   Γöé   025   19      EM    ^Y
  11254.     010   0A       LF    ^J   Γöé   026   1A      SUB   ^Z
  11255.     011   0B       VT    ^K   Γöé   027   1B      ESC   ^[
  11256.     012   0C       FF    ^L   Γöé   028   1C      FS    ^\
  11257.     013   0D       CR    ^M   Γöé   029   1D      GS    ^]
  11258.     014   0E      SO    ^N   Γöé   030   1E      RS    ^^
  11259.     015   0F      SI    ^O   Γöé   031   1F      US    ^_
  11260.  
  11261.                   Punctuation, Digits, Upper Case
  11262.  
  11263.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  11264.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  11265.   032   20      Γöé  048   30   0  Γöé  064   40   @  Γöé  080   50   P
  11266.   033   21   !  Γöé  049   31   1  Γöé  065   41   A  Γöé  081   51   Q
  11267.   034   22   "  Γöé  050   32   2  Γöé  066   42   B  Γöé  082   52   R
  11268.   035   23   #  Γöé  051   33   3  Γöé  067   43   C  Γöé  083   53   S
  11269.   036   24   $  Γöé  052   34   4  Γöé  068   44   D  Γöé  084   54   T
  11270.   037   25   %  Γöé  053   35   5  Γöé  069   45   E  Γöé  085   55   U
  11271.   038   26   &  Γöé  054   36   6  Γöé  070   46   F  Γöé  086   56   V
  11272.   039   27   '  Γöé  055   37   7  Γöé  071   47   G  Γöé  087   57   W
  11273.   040   28   (  Γöé  056   38   8  Γöé  072   48   H  Γöé  088   58   X
  11274.   041   29   )  Γöé  057   39   9  Γöé  073   49   I  Γöé  089   59   Y
  11275.   042   2A   *  Γöé  058   3A   :  Γöé  074   4A   J  Γöé  090   5A   Z
  11276.   043   2B   +  Γöé  059   3B   ;  Γöé  075   4B   K  Γöé  091   5B   [
  11277.   044   2C   ,  Γöé  060   3C   <  Γöé  076   4C   L  Γöé  092   5C   \
  11278.   045   2D   -  Γöé  061   3D   =  Γöé  077   4D   M  Γöé  093   5D   ]
  11279.   046   2E   .  Γöé  062   3E   >  Γöé  078   4E   N  Γöé  094   5E   ^
  11280.   047   2F   /  Γöé  063   3F   ?  Γöé  079   4F   O  Γöé  095   5F   _
  11281.  
  11282.                    Lower Case, Miscellaneous
  11283.  
  11284.                  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  11285.                  ---  ---  --- Γöé  ---  ---  ---
  11286.                  096   60   `  Γöé  112   70   p
  11287.                  097   61   a  Γöé  113   71   q
  11288.                  098   62   b  Γöé  114   72   r
  11289.                  099   63   c  Γöé  115   73   s
  11290.                  100   64   d  Γöé  116   74   t
  11291.                  101   65   e  Γöé  117   75   u
  11292.                  102   66   f  Γöé  118   76   v
  11293.                  103   67   g  Γöé  119   77   w
  11294.                  104   68   h  Γöé  120   78   x
  11295.                  105   69   i  Γöé  121   79   y
  11296.                  106   6A   j  Γöé  122   7A   z
  11297.                  107   6B   k  Γöé  123   7B   {
  11298.                  108   6C   l  Γöé  124   7C   |
  11299.                  109   6D   m  Γöé  125   7D   }
  11300.                  110   6E   n  Γöé  126   7E   ~
  11301.                  111   6F   o  Γöé  127   7F   
  11302.  
  11303.                 International; Graphics Characters 1
  11304.  
  11305.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  11306.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  11307.   128   80   ╨É  Γöé  144   90   ╨á  Γöé  160   A0   ╨░  Γöé  176   B0   Γûæ
  11308.   129   81   ╨æ  Γöé  145   91   ╨í  Γöé  161   A1   ╨▒  Γöé  177   B1   ΓûÆ
  11309.   130   82   ╨Æ  Γöé  146   92   ╨ó  Γöé  162   A2   ╨▓  Γöé  178   B2   Γûô
  11310.   131   83   ╨ô  Γöé  147   93   ╨ú  Γöé  163   A3   ╨│  Γöé  179   B3   Γöé
  11311.   132   84   ╨ö  Γöé  148   94   ╨ñ  Γöé  164   A4   ╨┤  Γöé  180   B4   Γöñ
  11312.   133   85   ╨ò  Γöé  149   95   ╨Ñ  Γöé  165   A5   ╨╡  Γöé  181   B5   Γòí
  11313.   134   86   ╨û  Γöé  150   96   ╨ª  Γöé  166   A6   ╨╢  Γöé  182   B6   Γòó
  11314.   135   87   ╨ù  Γöé  151   97   ╨º  Γöé  167   A7   ╨╖  Γöé  183   B7   Γòû
  11315.   136   88   ╨ÿ  Γöé  152   98   ╨¿  Γöé  168   A8   ╨╕  Γöé  184   B8   Γòò
  11316.   137   89   ╨Ö  Γöé  153   99   ╨⌐  Γöé  169   A9   ╨╣  Γöé  185   B9   Γòú
  11317.   138   8A   ╨Ü  Γöé  154   9A   ╨¬  Γöé  170   AA   ╨║  Γöé  186   BA   Γòæ
  11318.   139   8B   ╨¢  Γöé  155   9B   ╨½  Γöé  171   AB   ╨╗  Γöé  187   BB   Γòù
  11319.   140   8C   ╨£  Γöé  156   9C   ╨¼  Γöé  172   AC   ╨╝  Γöé  188   BC   Γò¥
  11320.   141   8D   ╨¥  Γöé  157   9D   ╨¡  Γöé  173   AD   ╨╜  Γöé  189   BD   Γò£
  11321.   142   8E   ╨₧  Γöé  158   9E   ╨«  Γöé  174   AE   ╨╛  Γöé  190   BE   Γò¢
  11322.   143   8F   ╨ƒ  Γöé  159   9F   ╨»  Γöé  175   AF   ╨┐  Γöé  191   BF   ΓöÉ
  11323.  
  11324.                   Graphics Characters 2; Symbols
  11325.  
  11326.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  11327.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  11328.   192   C0   Γöö  Γöé  208   D0   Γò¿  Γöé  224   E0   ╤Ç  Γöé  240   F0   ╨ü
  11329.   193   C1   Γö┤  Γöé  209   D1   Γòñ  Γöé  225   E1   ╤ü  Γöé  241   F1   ╤æ
  11330.   194   C2   Γö¼  Γöé  210   D2   ΓòÑ  Γöé  226   E2   ╤é  Γöé  242   F2   ╨ä
  11331.   195   C3   Γö£  Γöé  211   D3   ΓòÖ  Γöé  227   E3   ╤â  Γöé  243   F3   ╤ö
  11332.   196   C4   ΓöÇ  Γöé  212   D4   Γòÿ  Γöé  228   E4   ╤ä  Γöé  244   F4   ╨ç
  11333.   197   C5   Γö╝  Γöé  213   D5   ΓòÆ  Γöé  229   E5   ╤à  Γöé  245   F5   ╤ù
  11334.   198   C6   Γò₧  Γöé  214   D6   Γòô  Γöé  230   E6   ╤å  Γöé  246   F6   ╨Ä
  11335.   199   C7   Γòƒ  Γöé  215   D7   Γò½  Γöé  231   E7   ╤ç  Γöé  247   F7   ╤₧
  11336.   200   C8   ΓòÜ  Γöé  216   D8   Γò¬  Γöé  232   E8   ╤ê  Γöé  248   F8   ┬░
  11337.   201   C9   Γòö  Γöé  217   D9   Γöÿ  Γöé  233   E9   ╤ë  Γöé  249   F9   ΓêÖ
  11338.   202   CA   Γò⌐  Γöé  218   DA   Γöî  Γöé  234   EA   ╤è  Γöé  250   FA   ┬╖
  11339.   203   CB   Γòª  Γöé  219   DB   Γûê  Γöé  235   EB   ╤ï  Γöé  251   FB   ΓêÜ
  11340.   204   CC   Γòá  Γöé  220   DC   Γûä  Γöé  236   EC   ╤î  Γöé  252   FC   Γäû
  11341.   205   CD   ΓòÉ  Γöé  221   DD   Γûî  Γöé  237   ED   ╤ì  Γöé  253   FD   ┬ñ
  11342.   206   CE   Γò¼  Γöé  222   DE   ΓûÉ  Γöé  238   EE   ╤Ä  Γöé  254   FE   Γûá
  11343.   207   CF   Γòº  Γöé  223   DF   ΓûÇ  Γöé  239   EF   ╤Å  Γöé  255   FF
  11344.  
  11345.  
  11346. ΓòÉΓòÉΓòÉ 16.2. Key Codes and Scan Codes Table ΓòÉΓòÉΓòÉ
  11347.  
  11348. (For more details on key codes and scan codes, see the Key Codes and Scan Codes 
  11349. Explanation.) 
  11350.  
  11351. Key names prefaced by np are on the numeric keypad.  Those prefaced by cp are 
  11352. on the cursor keypad between the main typing keys and the number keypad.  The 
  11353. numeric keypad values are valid if Num Lock is turned off.  If you need to 
  11354. specify a number key from the numeric keypad, use the scan code shown for the 
  11355. keypad and the ASCII code shown for the corresponding typewriter key.  For 
  11356. example, the keypad "7" has a scan code of 71 (the np Home scan code) and an 
  11357. ASCII code of 54 (the ASCII code for "7"). 
  11358.  
  11359. The chart is blank for key combinations that do not have scan codes or ASCII 
  11360. codes, like Ctrl-1 or Alt-PgUp. 
  11361.  
  11362.  
  11363.                         Top Two Keyboard Rows
  11364.  
  11365.                              Shift  Shift  Ctrl   Ctrl   Alt
  11366.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  11367.      Key       Code   Code   Code   Code   Code   Code   Code
  11368.  
  11369.      Esc       1      27     1      27     1      27     1
  11370.      1  !      2      49     2      33                   120
  11371.      2  @      3      50     3      64     3      0      121
  11372.      3  #      4      51     4      35                   122
  11373.      4  $      5      52     5      36                   123
  11374.      5  %      6      53     6      37                   124
  11375.      6  ^      7      54     7      94     7      30     125
  11376.      7  &      8      55     8      38                   126
  11377.      8  *      9      56     9      42                   127
  11378.      9  (      10     57     10     40                   128
  11379.      0  )      11     48     11     41                   129
  11380.      -  _      12     45     12     95     12     31     130
  11381.      =  +      13     61     13     43                   131
  11382.      Backspace 14     8      14     8      14     127    14
  11383.      Tab       15     9      15     0      148    0      165
  11384.      Q         16     113    16     81     16     17     16
  11385.      W         17     119    17     87     17     23     17
  11386.      E         18     101    18     69     18     5      18
  11387.      R         19     114    19     82     19     18     19
  11388.      T         20     116    20     84     20     20     20
  11389.      Y         21     121    21     89     21     25     21
  11390.      U         22     117    22     85     22     21     22
  11391.      I         23     105    23     73     23     9      23
  11392.      O         24     111    24     79     24     15     24
  11393.      P         25     112    25     80     25     16     25
  11394.      [  {      26     91     26     123    26     27     26
  11395.      ]  }      27     93     27     125    27     29     27
  11396.      Enter     28     13     28     13     28     10     28
  11397.  
  11398.  
  11399.                        Bottom Two Keyboard Rows
  11400.  
  11401.                              Shift  Shift  Ctrl   Ctrl   Alt
  11402.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  11403.      Key       Code   Code   Code   Code   Code   Code   Code
  11404.  
  11405.     A          30     97     30     65     30     1      30
  11406.     S          31     115    31     83     31     19     31
  11407.     D          32     100    32     68     32     4      32
  11408.     F          33     102    33     70     33     6      33
  11409.     G          34     103    34     71     34     7      34
  11410.     H          35     104    35     72     35     8      35
  11411.     J          36     106    36     74     36     10     36
  11412.     K          37     107    37     75     37     11     37
  11413.     L          38     108    38     76     38     12     38
  11414.     ; :        39     59     39     58                   39
  11415.     '  "       40     39     40     34                   40
  11416.     `  ~       41     96     41     126                  41
  11417.     \  |       43     92     43     124    43     28     43
  11418.     Z          44     122    44     90     44     26     44
  11419.     X          45     120    45     88     45     24     45
  11420.     C          46     99     46     67     46     3      46
  11421.     V          47     118    47     86     47     22     47
  11422.     B          48     98     48     66     48     2      48
  11423.     N          49     110    49     78     49     14     49
  11424.     M          50     109    50     77     50     13     50
  11425.     ,  <       51     44     51     60                   51
  11426.     .  >       52     46     52     62                   52
  11427.     /  ?       53     47     53     63                   53
  11428.     Space      57     32     57     32     57     32     57
  11429.  
  11430.  
  11431.                       Key Pads and Function Keys
  11432.  
  11433.                              Shift  Shift  Ctrl   Ctrl   Alt
  11434.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  11435.      Key       Code   Code   Code   Code   Code   Code   Code
  11436.  
  11437.  
  11438.      F1        59     0      84     0      94     0      104
  11439.      F2        60     0      85     0      95     0      105
  11440.      F3        61     0      86     0      96     0      106
  11441.      F4        62     0      87     0      97     0      107
  11442.      F5        63     0      88     0      98     0      108
  11443.      F6        64     0      89     0      99     0      109
  11444.      F7        65     0      90     0      100    0      110
  11445.      F8        66     0      91     0      101    0      111
  11446.      F9        67     0      92     0      102    0      112
  11447.      F10       68     0      93     0      103    0      113
  11448.      F11       133    0      135    0      137    0      139
  11449.      F12       134    0      136    0      138    0      140
  11450.      np *      55     42     55     42     150    0      55
  11451.      np Home   71     0      71     55     119    0
  11452.      cp Home   71     224    71     224    119    224    151
  11453.      np Up     72     0      72     56     141    0
  11454.      cp Up     72     224    72     224    141    224    152
  11455.      np PgUp   73     0      73     57     132    0
  11456.      cp PgUp   73     224    73     224    132    224    153
  11457.      np Minus  74     45     74     45     142    0      74
  11458.      np Left   75     0      75     52     115    0
  11459.      cp Left   75     224    75     224    115    224    155
  11460.      np 5      76     0      76     53     143    0
  11461.      np Right  77     0      77     54     116    0
  11462.      cp Right  77     224    77     224    116    224    157
  11463.      np Plus   78     43     78     43     144    0      78
  11464.      np End    79     0      79     49     117    0
  11465.      cp End    79     224    79     224    117    224    159
  11466.      np Down   80     0      80     50     145    0
  11467.      cp Down   80     224    80     224    145    224    160
  11468.      np PgDn   81     0      81     51     118    0
  11469.      cp PgDn   81     224    81     224    118    224    161
  11470.      np Ins    82     0      82     48     146    0
  11471.      cp Ins    82     224    82     224    146    224    162
  11472.      np Del    83     0      83     46     147    0
  11473.      cp Del    83     224    83     224    147    224    163
  11474.      np /      224    47     224    47     149    0      164
  11475.      np Enter  224    13     224    13     224    10     166
  11476.  
  11477.  
  11478. ΓòÉΓòÉΓòÉ 16.3. Key Codes and Scan Codes Explanation ΓòÉΓòÉΓòÉ
  11479.  
  11480. (This section explains how key codes and scan codes work.  For a reference 
  11481. chart, see the Key Codes and Scan Codes Table.) 
  11482.  
  11483. When you press a single key or a key combination, OS/2 translates your 
  11484. keystroke into two numbers: a scan code, representing the actual key that was 
  11485. pressed, and an ASCII code, representing the ASCII value for that key.  OS/2 
  11486. returns these numbers the next time a program requests keyboard input.  This 
  11487. section explains how key codes work; for information on using them with 4OS2 
  11488. see the 4OS2.INI file key mapping directives, keystroke aliases, and INKEY. 
  11489.  
  11490. Most 4OS2 commands that use the numeric key codes listed here also use key 
  11491. names, which are usually more convenient to use than the numeric codes.  See 
  11492. Keys and Key Names for more information on key names. 
  11493.  
  11494. As PCs have evolved, the structure of keyboard codes has evolved somewhat 
  11495. haphazardly with them, resulting in a bewildering array of possible key codes. 
  11496. We'll give you a basic explanation of how key codes work.  For a more in-depth 
  11497. discussion, refer to a BIOS or PC hardware reference manual. 
  11498.  
  11499. The nuances of how your keyboard behaves depends on the keyboard manufacturer, 
  11500. the computer manufacturer who provides the built-in BIOS, and your operating 
  11501. system.  As a result, we can't guarantee the accuracy of the information in the 
  11502. tables for every system, but the discussion and reference table should be 
  11503. accurate for most systems.  Our discussion is based on the 101-key "enhanced" 
  11504. keyboard commonly used on 286, 386, 486, and Pentium computers, but virtually 
  11505. all of it is applicable to the 84-key keyboards on older systems.  The primary 
  11506. difference is that older keyboards lack a separate cursor pad and only have 10 
  11507. function keys. 
  11508.  
  11509. All keys have a scan code, but not all have an ASCII code.  For example, 
  11510. function keys and cursor keys are not part of the ASCII character set and have 
  11511. no ASCII value, but they do have a scan code.  Some keys have more than one 
  11512. ASCII code.  The A, for example, has ASCII code 97 (lower case "a") if you 
  11513. press it by itself.  If you press it along with Shift, the ASCII code changes 
  11514. to 65 (upper case "A").  If you press Ctrl and A the ASCII code changes to 1. 
  11515. In all these cases, the scan code (30) is unchanged because you are pressing 
  11516. the same physical key. 
  11517.  
  11518. Things are different if you press Alt-A.  Alt keystrokes have no ASCII code, so 
  11519. OS/2 returns an ASCII code of 0, along with the A key's scan code of 30.  This 
  11520. allows a program to detect all the possible variations of A, based on the 
  11521. combination of ASCII code and scan code. 
  11522.  
  11523. Some keys generate more than one scan code depending on whether Shift, Ctrl, or 
  11524. Alt is pressed.  This allows a program to differentiate between two different 
  11525. keystrokes on the same key, neither of which has a corresponding ASCII value. 
  11526. For example, F1 has no ASCII value so it returns an ASCII code of 0, and the F1 
  11527. scan code of 59.  Shift-F1 also returns an ASCII code 0; if it also returned a 
  11528. scan code of 59, a program couldn't distinguish it from F1.  The operating 
  11529. system translates scan codes for keys like Shift-F1 (and Ctrl-F1 and Alt-F1) so 
  11530. that each variation returns a different scan code along with an ASCII code of 
  11531. 0. 
  11532.  
  11533. On the 101-key keyboard there's one more variation:  non-ASCII keys on the 
  11534. cursor keypad (such as up-arrow) return the same scan code as the corresponding 
  11535. key on the numeric keypad, for compatibility reasons.  If they also returned an 
  11536. ASCII code of 0, a program couldn't tell which key was pressed.  Therefore, 
  11537. these keys return an ASCII code of 224 rather than 0.  This means that older 
  11538. programs, which only look for an ASCII 0 to indicate a non-ASCII keystroke like 
  11539. up-arrow, may not detect these cursor pad keys properly. 
  11540.  
  11541. The number of different codes returned by any given key varies from one (for 
  11542. the spacebar) to four, depending on the key, the design of your keyboard, and 
  11543. the operating system.  Some keys, like Alt, Ctrl, and Shift by themselves or in 
  11544. combination with each other, plus Print Screen, SysReq, Scroll Lock, Pause, 
  11545. Break, Num Lock, and Caps Lock keys, do not have any code representations at 
  11546. all.  The same is true of keystrokes with more than one modifying key, like 
  11547. Ctrl-Shift-A. The operating system may perform special actions automatically 
  11548. when you press these keys (for example, it switches into Caps Lock mode when 
  11549. you press Caps Lock), but it does not report the keystrokes to whatever program 
  11550. is running.  Programs which detect such keystrokes access the keyboard hardware 
  11551. directly, a subject which is beyond the scope of this manual. 
  11552.  
  11553.  
  11554. ΓòÉΓòÉΓòÉ 16.4. ANSI ΓòÉΓòÉΓòÉ
  11555.  
  11556. This section is a quick-reference to commonly-used ANSI commands. 
  11557.  
  11558. An ANSI command string consists of three parts: 
  11559.  
  11560.         ESC[                The ASCII character ESC, followed by a left 
  11561.                             bracket.  These two characters must be present in 
  11562.                             all ANSI strings. 
  11563.         parameters          Optional parameters for the command.  If there are 
  11564.                             multiple parameters they are separated by 
  11565.                             semicolons. 
  11566.         cmd                 A single-letter command.  The case of the letter IS 
  11567.                             meaningful. 
  11568.  
  11569.  For example, to position the cursor to row 7, column 12 the ANSI command is: 
  11570.  
  11571.           ESC[7;12H
  11572.  
  11573.  To transmit ANSI commands to the screen with 4OS2, you should use the ECHO 
  11574.  command.  The ESC character can be generated by inserting it into the string 
  11575.  directly (if you are putting the string in a batch file and your editor will 
  11576.  insert such a character), or by using 4OS2's internal "escape" character 
  11577.  (caret, [^]) followed by a lower-case "e".  For example, the sequence shown 
  11578.  above could be transmitted from a batch file with either of these commands 
  11579.  (the first uses an ESC character directly; the second uses ^e): 
  11580.  
  11581.           echo 2H
  11582.           echo ^e[7;12H
  11583.  
  11584.  You can also include ANSI commands in your prompt, using $e to transmit the 
  11585.  ESC character.  You can NOT use PROMPT to transmit ANSI commands to the screen 
  11586.  from a batch file (see PROMPT). 
  11587.  
  11588.  Commands 
  11589.  
  11590.         ESC[rowsA               Cursor up 
  11591.         ESC[rowsB               Cursor down 
  11592.         ESC[colsC               Cursor right 
  11593.         ESC[colsD               Cursor left 
  11594.         ESC[row;colH            Set cursor position (top left is row 1, column 
  11595.                                 1) 
  11596.         ESC[2J                  Clear screen 
  11597.         ESC[K                   Clear from cursor to end of line 
  11598.         ESC[row;colf            Set cursor position, same as "H" command 
  11599.         ESC[attr;attr;...m      Set display attributes; see table of attribute 
  11600.                                 values below 
  11601.         ESC[s                   Save cursor position (may not be nested) 
  11602.         ESC[u                   Restore cursor position after a save 
  11603.  
  11604.  Display Attributes 
  11605.  
  11606.         0           All attributes off (normal white on black) 
  11607.         1           High intensity (bold) 
  11608.         2           Normal intensity 
  11609.         4           Underline (usually effective only on monochrome displays) 
  11610.         5           Blinking 
  11611.         7           Reverse Video 
  11612.         8           Invisible 
  11613.         30-37       Set the foreground color: 
  11614.                       30=Black  31=Red    32=Green  33=Yellow 
  11615.                       34=Blue   35=Magenta  36=Cyan   37=White 
  11616.         40-47       Set the background color, same values as above but 
  11617.                     substitute 40 for 30 etc. 
  11618.  
  11619.  Settings are cumulative, so (for example) to set bright red foreground set all 
  11620.  attributes off, then set red, then bold, use: 
  11621.  
  11622.           echo ^e[0;31;1m
  11623.  
  11624.  Examples 
  11625.  
  11626.  Clear the display attributes, then set the display to bright cyan on blue, and 
  11627.  clear the screen: 
  11628.  
  11629.           echo ^e[0;44;36;1m^e[2J
  11630.  
  11631.  Set up a prompt which saves the cursor position, displays the 4DOS shell 
  11632.  level, date, and time on the top line in bright white on magenta, and then 
  11633.  restores the cursor position and sets the color to bright cyan on blue, and 
  11634.  displays the standard prompt: 
  11635.  
  11636.           prompt $e[s$e[1;1f$e[0;45;37;1m$e[K($z) $d $t$e[u$e[0;44;36;1m$p$g
  11637.  
  11638.  
  11639. ΓòÉΓòÉΓòÉ 17. Support ΓòÉΓòÉΓòÉ
  11640.  
  11641. You can contact JP Software at any of the following addresses.  Our normal 
  11642. business hours are 9:00 AM to 5:00 PM weekdays, eastern US time. 
  11643.  
  11644. By mail: 
  11645.  
  11646.         JP Software Inc. 
  11647.         P.O. Box 1470 
  11648.         East Arlington, MA 02174 
  11649.         USA 
  11650.  
  11651.  By telephone / fax: 
  11652.  
  11653.         Voice           (617) 646-3975 
  11654.         Fax             (617) 646-0904 
  11655.         Order Line      (800) 368-8777 (orders only, USA only) 
  11656.  
  11657.  Electronically: 
  11658.  
  11659.         CompuServe          Sales / Customer Service, 75020,244 
  11660.                             Technical Support, GO JPSOFT or GO PCVENB (section 
  11661.                             10), User ID 75300,1215 
  11662.  
  11663.         Internet Mail       Sales / Customer Service, sales@jpsoft.com 
  11664.                             Technical Support, support@jpsoft.com 
  11665.  
  11666.         World Wide Web      To download software and read information about new 
  11667.                             products and upgrades, visit our web site at 
  11668.                             http://www.jpsoft.com/. 
  11669.  
  11670.         BBS Support         Via Channel 1 BBS, Boston, 617-354-3230 (2,400 - 
  11671.                             14,400 baud) or 617-349-1300 (28,800 baud), no 
  11672.                             parity, 8 data bits, 1 stop bit. 
  11673.  
  11674.  Technical support is available via public electronic support conferences, 
  11675.  private electronic mail, telephone, fax, and mail. 
  11676.  
  11677.  Often the best way to contact us for support is in one of the following public 
  11678.  electronic support conferences.  The numbers in parentheses indicate the usual 
  11679.  delay, in business days, to receive a reply to a message. 
  11680.  
  11681.  CompuServe / ZiffNet:  Primary support is via the JP Software section of the 
  11682.  CompuServe PCVENB forum (GO JPSOFT or GO PCVENB, section 10, "JP Software") (1 
  11683.  day). 
  11684.  
  11685.  Bulletin Boards:  Primary support is via the Channel 1 BBS, Boston, MA (1 - 3 
  11686.  days; see above for access details).  Messages may be left in any of the 
  11687.  "4DOS" conferences; check the online list for exact conference numbers. 
  11688.  Support is also available from many local BBSes via the "4DOS" conferences on 
  11689.  the RIME, ILink, SmartNet, and FidoNet BBS Networks (3-5 days). 
  11690.  
  11691.  Before contacting us for support, please check the manuals and other 
  11692.  documentation for answers to your question.  If you can't find what you need, 
  11693.  try the Index.  If you're having trouble getting 4OS2 to run properly, either 
  11694.  alone or with your particular hardware or software, see the Introduction and 
  11695.  Installation Guide, and the APPNOTES.DOC file.  Also look through the 
  11696.  README.DOC and UPDATxxx.DOC files, as they may contain updates to the manual 
  11697.  or other important information ("xxx" is the version number). 
  11698.  
  11699.  If you do need to contact us for support, it helps if you can give us some 
  11700.  basic information: 
  11701.  
  11702.     *   What exactly did you do?  A concise description of what steps you must 
  11703.         take to make the problem appear is much more useful than a long 
  11704.         analysis of what might be happening. 
  11705.  
  11706.     *   What went wrong?  At what point did the failure occur?  If you saw an 
  11707.         error message or other important or unusual information on the screen, 
  11708.         what exactly did it say? 
  11709.  
  11710.     *   Briefly, what techniques did you use to try to resolve the problem? 
  11711.         What results did you get? 
  11712.  
  11713.     *   What computer and operating system version are you using? 
  11714.  
  11715.     *   Are you running a network?  If so, which one, and which version? 
  11716.  
  11717.     *   What are the contents of any startup files you use (such as CONFIG.SYS, 
  11718.         4START, 4EXIT, and 4OS2.INI ), any batch files they call, and any alias 
  11719.         or environment variable files they load? 
  11720.  
  11721.     *   Can you repeat the problem or does it occur randomly?  If it's random, 
  11722.         does it seem related to the programs you're using when the problem 
  11723.         occurs? 
  11724.